aws-elastic-beanstalk-cli-setup icon indicating copy to clipboard operation
aws-elastic-beanstalk-cli-setup copied to clipboard

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

Open mtmateer opened this issue 4 years ago • 20 comments

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

mtmateer avatar Mar 31 '20 16:03 mtmateer

@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.

rahulrajaram avatar Apr 01 '20 00:04 rahulrajaram

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

DiegoRBaquero avatar Jul 02 '20 01:07 DiegoRBaquero

Same

coletteking avatar Jul 25 '20 00:07 coletteking

Same error on macos 10.15.6. Followed directions in README, see log. Please assist, unable to deploy without tool :(

Last 10 log lines: File "/private/var/folders/1n/lykc0tvn0yl49f88p2ctw6940000gn/T/python-build.20200727220205.47613/Python-3.7.2/Lib/ensurepip/main.py", line 5, in sys.exit(ensurepip._main()) File "/private/var/folders/1n/lykc0tvn0yl49f88p2ctw6940000gn/T/python-build.20200727220205.47613/Python-3.7.2/Lib/ensurepip/init.py", line 204, in _main default_pip=args.default_pip, File "/private/var/folders/1n/lykc0tvn0yl49f88p2ctw6940000gn/T/python-build.20200727220205.47613/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/1n/lykc0tvn0yl49f88p2ctw6940000gn/T/python-build.20200727220205.47613/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

➜ Developer brew install zlib openssl readline CFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix readline)/include -I$(xcrun --show-sdk-path)/usr/include" LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix readline)/lib -L$(brew --prefix zlib)/lib" Warning: zlib 1.2.11 is already installed and up-to-date To reinstall 1.2.11, run brew reinstall zlib Warning: [email protected] 1.1.1g is already installed and up-to-date To reinstall 1.1.1g, run brew reinstall [email protected] Warning: readline 8.0.4 is already installed and up-to-date To reinstall 8.0.4, run brew reinstall readline

smushy129 avatar Jul 28 '20 02:07 smushy129

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

smushy129 avatar Jul 28 '20 03:07 smushy129

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

flyp-felype avatar Jul 29 '20 12:07 flyp-felype

I am having the same problem and nothing is working...please help

MeganSarah avatar Jul 30 '20 17:07 MeganSarah

I was having the same problems and followed the instructions from flip-felype and it worked great. Thanks.

Mark-enfortis-tech avatar Aug 17 '20 22:08 Mark-enfortis-tech

Works like a charm @flyp-felype

sftwre avatar Aug 27 '20 01:08 sftwre

Works like a charm @flyp-felype

JuliaShiweiHuang avatar Oct 17 '20 19:10 JuliaShiweiHuang

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

jerots avatar Nov 26 '20 09:11 jerots

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

Works perfectly thanks @kingsleyliao !!

ls-ramos avatar Feb 24 '21 15:02 ls-ramos

For 3.6.8, all above solutions doesn't work

Temirtator avatar Mar 16 '21 16:03 Temirtator

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

Finally, something that worked for me. Thanks!

Though now, having never used pyenv, I wonder what the python setup on my Mac is and whether I'm gonna be screwed next time I need to do something linked to a python environment. If anyone has info on the implications of these 2 commands I'd love to hear about it.

gvankeerberghen avatar Apr 18 '21 11:04 gvankeerberghen

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

Yusuke196 avatar Jul 19 '21 08:07 Yusuke196

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 [email protected] 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 [email protected] 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.

mike-roberts-ps avatar Jul 25 '21 22:07 mike-roberts-ps

Thank you @Yusuke196 💯

mfaizan1 avatar Jul 28 '21 08:07 mfaizan1

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

njsortor avatar Aug 31 '21 03:08 njsortor

@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.

This is the only solution i've found to fix this error after weeks of trying different solutions from SO and other forums. Thank you so much!

zkjet avatar Nov 17 '22 06:11 zkjet

All above didn't work for my case, but I resolved this problem by reinstalling Xcode CommandLineTools.

Seoritsu01 avatar Jan 23 '23 01:01 Seoritsu01