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

Python 3.5 Issue #454

Closed
nikolay opened this issue Oct 9, 2015 · 32 comments
Closed

Python 3.5 Issue #454

nikolay opened this issue Oct 9, 2015 · 32 comments

Comments

@nikolay
Copy link

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
Copy link
Contributor

yyuu commented Oct 9, 2015

You just don't have zlib.

@thomasjo
Copy link
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
Copy link
Author

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
Copy link
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
Copy link

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

@nikolay
Copy link
Author

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
Copy link
Contributor

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
Copy link

@swarajban
Copy link

@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
Copy link
Author

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
Copy link
Contributor

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
Copy link

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.

@qtfkwk
Copy link

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
Copy link
Contributor

yyuu commented Nov 13, 2015

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

@yyuu yyuu closed this as completed Nov 13, 2015
@intsilence
Copy link

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

@GregBakker
Copy link

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
Copy link

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
Copy link

abisuq commented Dec 22, 2015

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

@myconode
Copy link

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
Copy link

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

@dukeyu1991
Copy link

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

@robertwe
Copy link

robertwe commented May 7, 2016

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

@lianghuazhu0501
Copy link

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

@z-zkagami
Copy link

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

@candu
Copy link

candu commented Oct 6, 2016

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

@devenvexe
Copy link

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

@zzantares
Copy link

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
Copy link

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
Copy link

imidya commented Feb 16, 2017

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

@forrest-lee
Copy link

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

@jrzerr
Copy link

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
@joshfriend
Copy link
Member

see #1219

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

No branches or pull requests