Install fails on OS X (zipimport.ZipImportError: can't decompress data; zlib not available)
See original GitHub issueUsing Mac OS Mojave 10.14.5, bundled_installer fails to install Python with the following errors:
BUILD FAILED (OS X 10.14.5 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/n0/xxh86gld3jb5rxnnp1rtfv4h0000gn/T/python-build.20190722131429.87401
Results logged to /var/folders/n0/xxh86gld3jb5rxnnp1rtfv4h0000gn/T/python-build.20190722131429.87401.log
Last 10 log lines:
File "/private/var/folders/n0/xxh86gld3jb5rxnnp1rtfv4h0000gn/T/python-build.20190722131429.87401/Python-3.7.2/Lib/ensurepip/__main__.py", line 5, in <module>
sys.exit(ensurepip._main())
File "/private/var/folders/n0/xxh86gld3jb5rxnnp1rtfv4h0000gn/T/python-build.20190722131429.87401/Python-3.7.2/Lib/ensurepip/__init__.py", line 204, in _main
default_pip=args.default_pip,
File "/private/var/folders/n0/xxh86gld3jb5rxnnp1rtfv4h0000gn/T/python-build.20190722131429.87401/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/n0/xxh86gld3jb5rxnnp1rtfv4h0000gn/T/python-build.20190722131429.87401/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
==============================================
II. Creating self-contained EBCLI installation
==============================================
./bundled_installer: line 51: /Users/tomslot/.pyenv/versions/3.7.2/bin/python: No such file or directory
./bundled_installer: line 28: echo_with_indentation: command not found
Suggested workaround (installing zlib and setting CFLAGS) does not work for me.
PS. I also tried to execute:
python3 ebcli_installer.py
***********************************
1. Locating virtualenv installation
***********************************
ERROR: Could not find and "virtualenv" installed. Ensurevirtualenv is installed and that it is in PATH before executingthis script.
******************************************
2. Creating exclusive virtualenv for EBCLI
******************************************
/bin/sh: virtualenv: command not found
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
pyenv zlib error on MacOS - xcode - Stack Overflow
I am trying to install Python 2.7.5 and 3.6.5 side-by-side on my MBP with with pyenv. pyenv Installation. Following How can I use...
Read more >zipimport.ZipImportError: can't decompress data; zlib not ...
I run python3 get-pip.py to show the error message above, but it works for python get-pip.py . Yes, I can run yum search...
Read more >[Solved][Linux] Python Installation Error: zipimport.ZipImportError
Today when I installing a specific Python version on Linux, I encountered the following error message: "zipimport.ZipImportError: can't ...
Read more >SOLVED: OSX or macOS Sierra, error while installing python ...
Read how to solve the zipimport.ZipImportError: can't decompress data; zlib not available error while using pyenv to install a new python ...
Read more >How to solve zipimport.ZipImportError: can't decompress data
When I pass the final command, sudo make install, it prints the error “zipimport.ZipImportError: can't decompress data; zlib not available.”.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If someone else face this problem, you need to:
export LDFLAGS="-L/usr/local/opt/zlib/lib"
export CPPFLAGS="-I/usr/local/opt/zlib/include"
This way zlib will be available.
The above in isolation did not solve this issue for me. This did though:
sudo rm -r /usr/local/opt/zlib
brew install zlib
export LDFLAGS="-L/usr/local/opt/zlib/lib"
export CPPFLAGS="-I/usr/local/opt/zlib/include"
Same issue in this thread.