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

Python 3.5 Issue #454

Closed
nikolay opened this Issue Oct 9, 2015 · 31 comments

Comments

Projects
None yet
@nikolay

nikolay commented Oct 9, 2015

Suddenly, I get this error when trying to install Python 3.5 (started to happen with the latest version) on OS X 10.11:

Last 10 log lines:
  File "/private/var/folders/cb/cxxqz_g94jd1x5tjwrklxgd00000gn/T/python-build.20151008192643.16552/Python-3.5.0/Lib/ensurepip/__main__.py", line 4, in <module>
    ensurepip._main()
  File "/private/var/folders/cb/cxxqz_g94jd1x5tjwrklxgd00000gn/T/python-build.20151008192643.16552/Python-3.5.0/Lib/ensurepip/__init__.py", line 209, in _main
    default_pip=args.default_pip,
  File "/private/var/folders/cb/cxxqz_g94jd1x5tjwrklxgd00000gn/T/python-build.20151008192643.16552/Python-3.5.0/Lib/ensurepip/__init__.py", line 116, in bootstrap
    _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
  File "/private/var/folders/cb/cxxqz_g94jd1x5tjwrklxgd00000gn/T/python-build.20151008192643.16552/Python-3.5.0/Lib/ensurepip/__init__.py", line 40, in _run_pip
    import pip
zipimport.ZipImportError: can't decompress data; zlib not available
make: *** [install] Error 1
pyenv: version `3.5.0' is not installed
@yyuu

This comment has been minimized.

Show comment
Hide comment
@yyuu

yyuu Oct 9, 2015

Collaborator

You just don't have zlib.

Collaborator

yyuu commented Oct 9, 2015

You just don't have zlib.

@thomasjo

This comment has been minimized.

Show comment
Hide comment
@thomasjo

thomasjo Oct 9, 2015

Contributor

@nikolay Ensure that your Xcode (including Command Line Tools) is up to date. Latest version is v7.0.1.

Contributor

thomasjo commented Oct 9, 2015

@nikolay Ensure that your Xcode (including Command Line Tools) is up to date. Latest version is v7.0.1.

@nikolay

This comment has been minimized.

Show comment
Hide comment
@nikolay

nikolay Oct 9, 2015

I do have both, of course. zlib is installed via Homebrew and I have Xcode 7.1 beta and I haven't updated it since it worked last time, i.e. it's not the beta version of Xcode.

nikolay commented Oct 9, 2015

I do have both, of course. zlib is installed via Homebrew and I have Xcode 7.1 beta and I haven't updated it since it worked last time, i.e. it's not the beta version of Xcode.

@thomasjo

This comment has been minimized.

Show comment
Hide comment
@thomasjo

thomasjo Oct 9, 2015

Contributor

Well, something is wrong with your environment, because it works perfectly fine on my (clean) OS X 10.11 (15A284) system with Xcode 7.0.1 (7A1001).

Contributor

thomasjo commented Oct 9, 2015

Well, something is wrong with your environment, because it works perfectly fine on my (clean) OS X 10.11 (15A284) system with Xcode 7.0.1 (7A1001).

@karamosky

This comment has been minimized.

Show comment
Hide comment
@karamosky

karamosky Oct 9, 2015

Same issue for me too, 3.4.x build correctly but not 3.5, Xcode is up to date

karamosky commented Oct 9, 2015

Same issue for me too, 3.4.x build correctly but not 3.5, Xcode is up to date

@nikolay

This comment has been minimized.

Show comment
Hide comment
@nikolay

nikolay Oct 9, 2015

Well, I'm not sure what's wrong with my environment if 3.4.3 builds and 3.5.0 doesn't.

nikolay commented Oct 9, 2015

Well, I'm not sure what's wrong with my environment if 3.4.3 builds and 3.5.0 doesn't.

@yyuu

This comment has been minimized.

Show comment
Hide comment
@yyuu

yyuu Oct 9, 2015

Collaborator

Hmm, sounds interesting.

For more investigation, could you create a gist from output of 'pyenv install -v 3.5'?

Collaborator

yyuu commented Oct 9, 2015

Hmm, sounds interesting.

For more investigation, could you create a gist from output of 'pyenv install -v 3.5'?

@karamosky

This comment has been minimized.

Show comment
Hide comment
@swarajban

This comment has been minimized.

Show comment
Hide comment
@swarajban

swarajban Oct 18, 2015

@nikolay I had the same issue, and was able to fix by updating command line tools on OSX. Just run xcode-select --install

Once, that's finished, you should be able to install 3.5.0

swarajban commented Oct 18, 2015

@nikolay I had the same issue, and was able to fix by updating command line tools on OSX. Just run xcode-select --install

Once, that's finished, you should be able to install 3.5.0

@nikolay

This comment has been minimized.

Show comment
Hide comment
@nikolay

nikolay Oct 20, 2015

@swarajban I've done this, of course. It's not that. It does not work. I tried once more. Same exact issue. 3.4.3 works, 3.5.0 fails miserably.

nikolay commented Oct 20, 2015

@swarajban I've done this, of course. It's not that. It does not work. I tried once more. Same exact issue. 3.4.3 works, 3.5.0 fails miserably.

@yyuu

This comment has been minimized.

Show comment
Hide comment
@yyuu

yyuu Oct 21, 2015

Collaborator

Umm. I've finished upgrading to El Capitan, but I couldn't reproduce the build failure of 3.5.0 on it....

Collaborator

yyuu commented Oct 21, 2015

Umm. I've finished upgrading to El Capitan, but I couldn't reproduce the build failure of 3.5.0 on it....

@VirtualWolf

This comment has been minimized.

Show comment
Hide comment
@VirtualWolf

VirtualWolf Oct 27, 2015

I was having the same problem. The fix for me, despite already having Xcode installed and up-to-date (7.1), was running xcode-select --install and installing the command line tools.

VirtualWolf commented Oct 27, 2015

I was having the same problem. The fix for me, despite already having Xcode installed and up-to-date (7.1), was running xcode-select --install and installing the command line tools.

@yyuu yyuu added the question label Oct 28, 2015

@qtfkwk

This comment has been minimized.

Show comment
Hide comment
@qtfkwk

qtfkwk Oct 28, 2015

I also had this issue but it's fixed now via xcode-select --install... I have XCode 7.1... Homebrew, etc, are working fine otherwise... no complaints about xcode-select, libraries missing, etc before trying to install Python 3.5.0. I will try to remember to run xcode-select --install from now on after upgrading XCode. Here's a copy of my session:

$ pyenv install 3.5.0
Downloading Python-3.5.0.tgz...
-> https://yyuu.github.io/pythons/584e3d5a02692ca52fce505e68ecd77248a6f2c99adf9db144a39087336b0fe0
Installing Python-3.5.0...

BUILD FAILED (OS X 10.11.1 using python-build 20150818)

Inspect or clean up the working tree at /var/folders/t2/60dlskjn6hq8r4wbmnmp0_nm0000gn/T/python-build.20151028190759.49730
Results logged to /var/folders/t2/60dlskjn6hq8r4wbmnmp0_nm0000gn/T/python-build.20151028190759.49730.log

Last 10 log lines:
  File "/private/var/folders/t2/60dlskjn6hq8r4wbmnmp0_nm0000gn/T/python-build.20151028190759.49730/Python-3.5.0/Lib/ensurepip/__main__.py", line 4, in <module>
    ensurepip._main()
  File "/private/var/folders/t2/60dlskjn6hq8r4wbmnmp0_nm0000gn/T/python-build.20151028190759.49730/Python-3.5.0/Lib/ensurepip/__init__.py", line 209, in _main
    default_pip=args.default_pip,
  File "/private/var/folders/t2/60dlskjn6hq8r4wbmnmp0_nm0000gn/T/python-build.20151028190759.49730/Python-3.5.0/Lib/ensurepip/__init__.py", line 116, in bootstrap
    _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
  File "/private/var/folders/t2/60dlskjn6hq8r4wbmnmp0_nm0000gn/T/python-build.20151028190759.49730/Python-3.5.0/Lib/ensurepip/__init__.py", line 40, in _run_pip
    import pip
zipimport.ZipImportError: can't decompress data; zlib not available
make: *** [install] Error 1
$ xcode-select --install # clicked install button
xcode-select: note: install requested for command line developer tools
$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
$ pyenv install 3.5.0
Downloading Python-3.5.0.tgz...
-> https://yyuu.github.io/pythons/584e3d5a02692ca52fce505e68ecd77248a6f2c99adf9db144a39087336b0fe0
Installing Python-3.5.0...
Installed Python-3.5.0 to /Users/nick/.pyenv/versions/3.5.0

qtfkwk commented Oct 28, 2015

I also had this issue but it's fixed now via xcode-select --install... I have XCode 7.1... Homebrew, etc, are working fine otherwise... no complaints about xcode-select, libraries missing, etc before trying to install Python 3.5.0. I will try to remember to run xcode-select --install from now on after upgrading XCode. Here's a copy of my session:

$ pyenv install 3.5.0
Downloading Python-3.5.0.tgz...
-> https://yyuu.github.io/pythons/584e3d5a02692ca52fce505e68ecd77248a6f2c99adf9db144a39087336b0fe0
Installing Python-3.5.0...

BUILD FAILED (OS X 10.11.1 using python-build 20150818)

Inspect or clean up the working tree at /var/folders/t2/60dlskjn6hq8r4wbmnmp0_nm0000gn/T/python-build.20151028190759.49730
Results logged to /var/folders/t2/60dlskjn6hq8r4wbmnmp0_nm0000gn/T/python-build.20151028190759.49730.log

Last 10 log lines:
  File "/private/var/folders/t2/60dlskjn6hq8r4wbmnmp0_nm0000gn/T/python-build.20151028190759.49730/Python-3.5.0/Lib/ensurepip/__main__.py", line 4, in <module>
    ensurepip._main()
  File "/private/var/folders/t2/60dlskjn6hq8r4wbmnmp0_nm0000gn/T/python-build.20151028190759.49730/Python-3.5.0/Lib/ensurepip/__init__.py", line 209, in _main
    default_pip=args.default_pip,
  File "/private/var/folders/t2/60dlskjn6hq8r4wbmnmp0_nm0000gn/T/python-build.20151028190759.49730/Python-3.5.0/Lib/ensurepip/__init__.py", line 116, in bootstrap
    _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
  File "/private/var/folders/t2/60dlskjn6hq8r4wbmnmp0_nm0000gn/T/python-build.20151028190759.49730/Python-3.5.0/Lib/ensurepip/__init__.py", line 40, in _run_pip
    import pip
zipimport.ZipImportError: can't decompress data; zlib not available
make: *** [install] Error 1
$ xcode-select --install # clicked install button
xcode-select: note: install requested for command line developer tools
$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
$ pyenv install 3.5.0
Downloading Python-3.5.0.tgz...
-> https://yyuu.github.io/pythons/584e3d5a02692ca52fce505e68ecd77248a6f2c99adf9db144a39087336b0fe0
Installing Python-3.5.0...
Installed Python-3.5.0 to /Users/nick/.pyenv/versions/3.5.0
@yyuu

This comment has been minimized.

Show comment
Hide comment
@yyuu

yyuu Nov 13, 2015

Collaborator

Run xcode-select --install to fix installation of Command Line Tools for Xcode working.

Collaborator

yyuu commented Nov 13, 2015

Run xcode-select --install to fix installation of Command Line Tools for Xcode working.

@yyuu yyuu closed this Nov 13, 2015

@intsilence

This comment has been minimized.

Show comment
Hide comment
@intsilence

intsilence Nov 14, 2015

I have the same problem, and it is fixed now by running xcode-select --install command.

intsilence commented Nov 14, 2015

I have the same problem, and it is fixed now by running xcode-select --install command.

@GregBakker

This comment has been minimized.

Show comment
Hide comment
@GregBakker

GregBakker Nov 29, 2015

Had the same problem but with installing 3.4.3 via pyenv. Having tried the suggestions above, was still having issues.

Installed python via brew was 3.5
3.4.3 would not install via pyenv with zipimport.ZipImportError: can't decompress data; zlib not available

On a hunch I did an
pyenv install 3.5
after which
pyenv install 3.4.3
worked fine.

GregBakker commented Nov 29, 2015

Had the same problem but with installing 3.4.3 via pyenv. Having tried the suggestions above, was still having issues.

Installed python via brew was 3.5
3.4.3 would not install via pyenv with zipimport.ZipImportError: can't decompress data; zlib not available

On a hunch I did an
pyenv install 3.5
after which
pyenv install 3.4.3
worked fine.

@mxreppy

This comment has been minimized.

Show comment
Hide comment
@mxreppy

mxreppy Dec 18, 2015

I have a somewhat weird laptop with corporate security. El Capitan 10.11.2, I was getting problems with cleaning up the build folder and found I needed

export KEEP_BUILD_PATH=true

just to skip over that step. then pyenv install -v 3.4.3 started working for me

(n.b. this was after getting the zlib error and reinstalling the xcode command line tools as outlined in this ticket)

thanks for pyenv!

mxreppy commented Dec 18, 2015

I have a somewhat weird laptop with corporate security. El Capitan 10.11.2, I was getting problems with cleaning up the build folder and found I needed

export KEEP_BUILD_PATH=true

just to skip over that step. then pyenv install -v 3.4.3 started working for me

(n.b. this was after getting the zlib error and reinstalling the xcode command line tools as outlined in this ticket)

thanks for pyenv!

@abisuq

This comment has been minimized.

Show comment
Hide comment
@abisuq

abisuq Dec 22, 2015

Run 'xcode-select --install' can't fix my problem.

abisuq commented Dec 22, 2015

Run 'xcode-select --install' can't fix my problem.

@thelostspore

This comment has been minimized.

Show comment
Hide comment
@thelostspore

thelostspore Feb 27, 2016

fwiw I was experiencing this, and already had xcode command line tools installed. However, running xcode-select --install did fix the 3.5.1 install problem on my machine (running OSX 10.11.3).

thelostspore commented Feb 27, 2016

fwiw I was experiencing this, and already had xcode command line tools installed. However, running xcode-select --install did fix the 3.5.1 install problem on my machine (running OSX 10.11.3).

@penuel-leo

This comment has been minimized.

Show comment
Hide comment
@penuel-leo

penuel-leo Mar 4, 2016

thx,Run 'xcode-select --install' fix my problem.

penuel-leo commented Mar 4, 2016

thx,Run 'xcode-select --install' fix my problem.

@dukeyu1991

This comment has been minimized.

Show comment
Hide comment
@dukeyu1991

dukeyu1991 Mar 10, 2016

$ CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install 2.7.6
this help me to solve the problem.

dukeyu1991 commented Mar 10, 2016

$ CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install 2.7.6
this help me to solve the problem.

@robertwe

This comment has been minimized.

Show comment
Hide comment
@robertwe

robertwe May 7, 2016

Just wanna confirm. Solution provided by swarajban works perfectly
@swarajban: many thx

robertwe commented May 7, 2016

Just wanna confirm. Solution provided by swarajban works perfectly
@swarajban: many thx

@lianghuazhu0501

This comment has been minimized.

Show comment
Hide comment
@lianghuazhu0501

lianghuazhu0501 Aug 11, 2016

I Run 'xcode-select --install'. Fix this error, Thank you very much @swarajban

lianghuazhu0501 commented Aug 11, 2016

I Run 'xcode-select --install'. Fix this error, Thank you very much @swarajban

@z-zkagami

This comment has been minimized.

Show comment
Hide comment
@z-zkagami

z-zkagami Sep 1, 2016

thx so much.
MacOS 10.11.4 runs xcode-select --install fix the problem

z-zkagami commented Sep 1, 2016

thx so much.
MacOS 10.11.4 runs xcode-select --install fix the problem

@candu

This comment has been minimized.

Show comment
Hide comment
@candu

candu Oct 6, 2016

xcode-select --install also fixed this for me.

candu commented Oct 6, 2016

xcode-select --install also fixed this for me.

@devenvexe

This comment has been minimized.

Show comment
Hide comment
@devenvexe

devenvexe Oct 17, 2016

Confirmed xcode-select --install works for macOS Sierra 10.12.1

devenvexe commented Oct 17, 2016

Confirmed xcode-select --install works for macOS Sierra 10.12.1

@ZzAntares

This comment has been minimized.

Show comment
Hide comment
@ZzAntares

ZzAntares Dec 28, 2016

Yes I think we can't stress this enough, running xcode-select --install from the terminal even though you have xcode installed and up to date it fixes the issue.

Thanks!

ZzAntares commented Dec 28, 2016

Yes I think we can't stress this enough, running xcode-select --install from the terminal even though you have xcode installed and up to date it fixes the issue.

Thanks!

@timworx

This comment has been minimized.

Show comment
Hide comment
@timworx

timworx Jan 10, 2017

Here is the issue in the Python bug tracker

xcode-select --install alone did not fix the issue for me, I also ran xcode-select -s /Library/Developer/CommandLineTools to change the path for the CLI tools.
(It was previously /Applications/Xcode.app/Contents/Developer)

timworx commented Jan 10, 2017

Here is the issue in the Python bug tracker

xcode-select --install alone did not fix the issue for me, I also ran xcode-select -s /Library/Developer/CommandLineTools to change the path for the CLI tools.
(It was previously /Applications/Xcode.app/Contents/Developer)

@imidya

This comment has been minimized.

Show comment
Hide comment
@imidya

imidya Feb 16, 2017

Thanks so much!
Fix this error after running xcode-select --install.

imidya commented Feb 16, 2017

Thanks so much!
Fix this error after running xcode-select --install.

@lionrock

This comment has been minimized.

Show comment
Hide comment
@lionrock

lionrock Feb 23, 2017

Confirmed xcode-select --install works for macOS Sierra 10.12.3

lionrock commented Feb 23, 2017

Confirmed xcode-select --install works for macOS Sierra 10.12.3

@jrzerr

This comment has been minimized.

Show comment
Hide comment
@jrzerr

jrzerr Mar 30, 2017

The xcode-select --install solved the same issue for me on OS X 10.12.3

jrzerr commented Mar 30, 2017

The xcode-select --install solved the same issue for me on OS X 10.12.3

@pyenv pyenv locked and limited conversation to collaborators Mar 30, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.