Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install fails, "zlib not available" #530

Closed
conery opened this issue Jan 21, 2016 · 13 comments
Closed

Install fails, "zlib not available" #530

conery opened this issue Jan 21, 2016 · 13 comments

Comments

@conery
Copy link

@conery conery commented Jan 21, 2016

Hi --

I used 'brew install pyenv', defined PYENV_ROOT and added pyenv init to my profile.

When I tried 'pyenv install 3.4.3' the process failed with the message "zipimport.ZipImportError: can't decompress data; zlib not available". I have zlib, also installed via brew.

Other info: OS X 10.11.2, Python 3.5.1 (installed with brew).

Any suggestions?

Thanks....

@dnmiller
Copy link

@dnmiller dnmiller commented Jan 23, 2016

Ran into this as well. Looks like a good ol' XCode update snuck in and clobbered zlib again.

xcode-select --install

solved it for me.

@yyuu
Copy link
Collaborator

@yyuu yyuu commented Feb 5, 2016

xcode-select should solve.

Please update the Wiki page if you realized something more needed.

https://github.com/yyuu/pyenv/wiki/Common-build-problems#build-failed-error-the-python-zlib-extension-was-not-compiled-missing-the-zlib

@yyuu yyuu closed this Feb 5, 2016
@geoidesic
Copy link

@geoidesic geoidesic commented Oct 10, 2018

xcode-select doesn't fix the issue for me on Mac OS X Mojave (10.14)

@WillDeuz
Copy link

@WillDeuz WillDeuz commented Oct 10, 2018

Hey @geoidesic to solve the problem on Mojave I ran

$ brew upgrade

Then

$ pyenv install 3.6.3

I have some warning from sqlite3 but the python version was installed.

@geoidesic
Copy link

@geoidesic geoidesic commented Oct 10, 2018

Thanks but that didn't work for me. Not sure if it's related but I'm trying to install 3.5.6.

@WillDeuz
Copy link

@WillDeuz WillDeuz commented Oct 10, 2018

did you see a pyenv package upgrade with "mojave" name on it when you run brew upgrade?

I would suggest to reinstall pyenv

@jmaroeder
Copy link

@jmaroeder jmaroeder commented Oct 10, 2018

What I had to do was specify CFLAGS as mentioned on the FAQ page, e.g.,

$ CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install -v 3.5.6
@geoidesic
Copy link

@geoidesic geoidesic commented Oct 10, 2018

What I had to do was specify CFLAGS as mentioned on the FAQ page, e.g.,

$ CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install -v 3.5.6

Is that for .bash_profile?

@guidefreitas
Copy link

@guidefreitas guidefreitas commented Oct 10, 2018

Same problem here in Mojave.

It did install the mojave pyenv package but fails to install python 3.7.0 with "zipimport.ZipImportError: can't decompress data; zlib not available"

@jamesmallen trick worked.
CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install 3.7.0

@WillDeuz
Copy link

@WillDeuz WillDeuz commented Oct 10, 2018

Seems the solution is:

  1. Install the Mojave pyenv package
  2. export the env variables with the path
@bobinson
Copy link

@bobinson bobinson commented Oct 10, 2018

same problem for me too & the following worked

CPPFLAGS="-I/usr/local/opt/zlib/include" pyenv install -v 3.7.0

@joshfriend
Copy link
Member

@joshfriend joshfriend commented Oct 10, 2018

Zlib not being found on mojave is a separate issue: #1219

@pyenv pyenv locked as resolved and limited conversation to collaborators Oct 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
10 participants