-
Notifications
You must be signed in to change notification settings - Fork 0
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
pyenv install 3.6.6 - zipimport.ZipImportError: can't decompress data; zlib not available #13
Comments
It saves my time. Thanks |
Thank you! #For compilers to find zlib you may need to set: #For pkg-config to find zlib you may need to set: #For compilers to find zlib you may need to set: #For pkg-config to find zlib you may need to set: export LDFLAGS="-L/usr/local/opt/sqlite/lib" |
You don't need to add anything permanently to your dotfiles, the flags just need to be set during compile time. So just set the environment variables in your shell session. This worked for me: $ brew install zlib
$ brew install sqlite
$ export LDFLAGS="${LDFLAGS} -L/usr/local/opt/zlib/lib"
$ export CPPFLAGS="${CPPFLAGS} -I/usr/local/opt/zlib/include"
$ export LDFLAGS="${LDFLAGS} -L/usr/local/opt/sqlite/lib"
$ export CPPFLAGS="${CPPFLAGS} -I/usr/local/opt/sqlite/include"
$ export PKG_CONFIG_PATH="${PKG_CONFIG_PATH} /usr/local/opt/zlib/lib/pkgconfig"
$ export PKG_CONFIG_PATH="${PKG_CONFIG_PATH} /usr/local/opt/sqlite/lib/pkgconfig"
$ pyenv install 3.6.8 |
Thanks @antonagestam , worked like a charm! |
Thanks @antonagestam for the instructions (I just wish you removed the I can't believe this is the only resource on the web for this problem. I haven't had this issue so far, using Homebrew and pyenv. What caused this change? |
@slhck It is not the only resource for this on the web, it is a reported issue on the pyenv project: pyenv/pyenv#1219 The dollar signs are in there to prevent people from copy-pasting code without knowing what they're doing. |
Thanks for the link. I was a little imprecise in my statement, but this was the most prominent search result I got for this particular error, with a simple fix presented. The others being pyenv/pyenv#454 (which suggests |
cat <<EOT >> ~/.zshrc
# For compilers to find zlib you may need to set:
export LDFLAGS="${LDFLAGS} -L/usr/local/opt/zlib/lib"
export CPPFLAGS="${CPPFLAGS} -I/usr/local/opt/zlib/include"
# For pkg-config to find zlib you may need to set:
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH} /usr/local/opt/zlib/lib/pkgconfig"
EOT Edit: above is permanent, thus (as @antonagestam said) wrong. His answer for the lazy: brew install zlib
brew install sqlite
export LDFLAGS="${LDFLAGS} -L/usr/local/opt/zlib/lib"
export CPPFLAGS="${CPPFLAGS} -I/usr/local/opt/zlib/include"
export LDFLAGS="${LDFLAGS} -L/usr/local/opt/sqlite/lib"
export CPPFLAGS="${CPPFLAGS} -I/usr/local/opt/sqlite/include"
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH} /usr/local/opt/zlib/lib/pkgconfig"
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH} /usr/local/opt/sqlite/lib/pkgconfig"
pyenv install 3.6.8 |
This saved me a lot of time! |
For someone using fish shell can check this out https://gist.github.com/empeje/fd7b654b2e57e33f74b833fedcd5f51e |
Thanks, @antonagestam for instructions. It really helped a lot. |
For fish shell
|
Ok, I loved the problem on a Mac using Mojave OS. I first removed pyenv
Then installed it using homebrew
That did it. The website where I got the info was here: |
Thanks @antonagestam . To cover future installs, I used an alias to turn the concept you're using that sets those values every time I invoke alias pyenv='LDFLAGS="${LDFLAGS} -L/usr/local/opt/zlib/lib -L/usr/local/opt/sqlite/lib" CPPFLAGS="${CPPFLAGS} -I/usr/local/opt/zlib/include -I/usr/local/opt/sqlite/include" PKG_CONFIG_PATH="${PKG_CONFIG_PATH} /usr/local/opt/zlib/lib/pkgconfig /usr/local/opt/sqlite/lib/pkgconfig" pyenv' |
The alias worked very well for me!!! 👌🏻 |
ran into similar problem on Linux Mint (Ubuntu) found this issue during searching. did the following:
did more googlings/search pyenv issues, then found this page that might cover additional build issues (assorted Linux and macOS listed), and it lists many other potential build dependencies https://github.com/pyenv/pyenv/wiki/Common-build-problems |
The Another approach is to use The Apple notes suggest that this is a bug in PyEnv:
|
For me it didn't work, what worked is
|
thanks it's worked on debian 9 GCP |
I can confirm that this fixed my problems |
Looks like this is safe to close out, no? Also, my solution for Linux: If you don't have |
I am still hitting a wall with installing versions of python < 3.10.0.
I've managed to narrow it down to setting
This results in the following, and its head against the wall for me. So any help is appreciated.
I've installed my dependencies via |
pyenv install 3.6.6 - zipimport.ZipImportError: can't decompress data; zlib not available
Issue
Fix
Install zlib
Add the following to your
~/.zshrc
(if you use zsh)DO NOT FORGET TO ADD
${LDFLAGS}
,${CPPFLAGS}
,${PKG_CONFIG_PATH}
!The text was updated successfully, but these errors were encountered: