aws-elastic-beanstalk-cli-setup: BUILD FAILED (OS X 10.15.4 using python-build 20180424)

getting the error

BUILD FAILED (OS X 10.15.4 using python-build 20180424)

Inspect or clean up the working tree at /var/folders/3z/jdm_tbt56n97ch0_75f497880000gn/T/python-build.20200331123651.7278
Results logged to /var/folders/3z/jdm_tbt56n97ch0_75f497880000gn/T/python-build.20200331123651.7278.log

Last 10 log lines:
  File "/private/var/folders/3z/jdm_tbt56n97ch0_75f497880000gn/T/python-build.20200331123651.7278/Python-3.7.2/Lib/ensurepip/__main__.py", line 5, in <module>
    sys.exit(ensurepip._main())
  File "/private/var/folders/3z/jdm_tbt56n97ch0_75f497880000gn/T/python-build.20200331123651.7278/Python-3.7.2/Lib/ensurepip/__init__.py", line 204, in _main
    default_pip=args.default_pip,
  File "/private/var/folders/3z/jdm_tbt56n97ch0_75f497880000gn/T/python-build.20200331123651.7278/Python-3.7.2/Lib/ensurepip/__init__.py", line 117, in _bootstrap
    return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
  File "/private/var/folders/3z/jdm_tbt56n97ch0_75f497880000gn/T/python-build.20200331123651.7278/Python-3.7.2/Lib/ensurepip/__init__.py", line 27, in _run_pip
    import pip._internal
zipimport.ZipImportError: can't decompress data; zlib not available
make: *** [install] Error 1
   Exiting due to failure

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 4
  • Comments: 20 (1 by maintainers)

Most upvoted comments

I was able to solve this by running:

brew install pyenv pyenv install 3.7.2

Wish I found the other thread earlier, would have saved me 2 hours. https://github.com/aws/aws-elastic-beanstalk-cli-setup/issues/23

Run brew install zlib Follow the instruction in installation message of zlib to create a symlink Follw the Mac OS specific instructions here

In my case, these actions did not work. Instead, using a patch mentioned in this comment solved the issue. In order to install python 3.7.2, I ran:

pyenv install --patch 3.7.2 < <(curl -sSL https://github.com/python/cpython/commit/8ea6353.patch\?full_index\=1)

My environments are:

  • macOS Big Sur 11.4
  • XCode 12.5.1

Tried many times, didn’t work, reinstall zlib, symlinked, everything.

This worked for me. Thanks for sharing in this thread @Yusuke196 .

My environments are similarly:

  • macOS Big Sur 11.4
  • XCode 12.5.1

Before

pyenv install 3.7.2                               ✔  1m 53s   system 
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.7.2.tar.xz...
-> https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tar.xz
Installing Python-3.7.2...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk

BUILD FAILED (OS X 11.4 using python-build 20180424)

Inspect or clean up the working tree at /var/folders/v7/d5949tg5705cxc4y5wcsdjrc0000gn/T/python-build.20210726074411.87159
Results logged to /var/folders/v7/d5949tg5705cxc4y5wcsdjrc0000gn/T/python-build.20210726074411.87159.log

Last 10 log lines:
clang -c -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include   -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include   -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration   -I. -I./Include -I/usr/local/opt/readline/include -I/usr/local/opt/readline/include -I/Users/mikeroberts/.pyenv/versions/3.7.2/include -I/usr/local/opt/zlib/include -I/usr/local/opt/bzip2/include -I/usr/local/opt/readline/include -I/usr/local/opt/readline/include -I/Users/mikeroberts/.pyenv/versions/3.7.2/include -I/usr/local/opt/zlib/include -I/usr/local/opt/bzip2/include  -DPy_BUILD_CORE -o Modules/gcmodule.o Modules/gcmodule.c
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include   -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include   -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration   -I. -I./Include -I/usr/local/opt/readline/include -I/usr/local/opt/readline/include -I/Users/mikeroberts/.pyenv/versions/3.7.2/include -I/usr/local/opt/zlib/include -I/usr/local/opt/bzip2/include -I/usr/local/opt/readline/include -I/usr/local/opt/readline/include -I/Users/mikeroberts/.pyenv/versions/3.7.2/include -I/usr/local/opt/zlib/include -I/usr/local/opt/bzip2/include  -DPy_BUILD_CORE_BUILTIN  -DPy_BUILD_CORE -c ./Modules/posixmodule.c -o Modules/posixmodule.o
./Modules/posixmodule.c:8409:15: error: implicit declaration of function 'sendfile' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        ret = sendfile(in, out, offset, &sbytes, &sf, flags);
              ^
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include   -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include   -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration   -I. -I./Include -I/usr/local/opt/readline/include -I/usr/local/opt/readline/include -I/Users/mikeroberts/.pyenv/versions/3.7.2/include -I/usr/local/opt/zlib/include -I/usr/local/opt/bzip2/include -I/usr/local/opt/readline/include -I/usr/local/opt/readline/include -I/Users/mikeroberts/.pyenv/versions/3.7.2/include -I/usr/local/opt/zlib/include -I/usr/local/opt/bzip2/include  -DPy_BUILD_CORE_BUILTIN  -c ./Modules/errnomodule.c -o Modules/errnomodule.o
1 error generated.
make: *** [Modules/posixmodule.o] Error 1
make: *** Waiting for unfinished jobs....
1 warning generated.

After

pyenv install --patch 3.7.2 < <(curl -sSL https://github.com/python/cpython/commit/8ea6353.patch\?full_index\=1)  1 ✘  1m 25s   system 

python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.7.2.tar.xz...
-> https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tar.xz
Installing Python-3.7.2...
patching file Misc/NEWS.d/next/macOS/2020-06-24-13-51-57.bpo-41100.mcHdc5.rst
patching file configure
Hunk #1 succeeded at 3375 (offset -51 lines).
patching file configure.ac
Hunk #1 succeeded at 490 (offset -20 lines).
python-build: use readline from homebrew
python-build: use zlib from xcode sdk


Installed Python-3.7.2 to

Which meant I could finally install the aws eb-client:

./aws-elastic-beanstalk-cli-setup/scripts/bundled_installer

Previously I’d tried the various methods of reinstalling dependencies with brew, reinstalling xcode command line tools etc.

I was able to solve this by running:

brew install pyenv pyenv install 3.7.2

Wish I found the other thread earlier, would have saved me 2 hours. #23

It worked for me

It was the guy above flyp-felype who posted the answer

Thank you @Yusuke196 💯

@mtmateer , thanks for reaching out.

  1. Run brew install zlib
  2. Follow the instruction in installation message of zlib to create a symlink
  3. Follw the Mac OS specific instructions here
  4. rerun the bundle installer.

Thanks @mike-roberts-ps!! Worked like a charm. Sucks I wasted a lot of other time on other threads. Lol.