Fla*_*air 94 rhel python pip python3
在 RHEL 6.6 上,我从源代码安装了 Python 3.5.1。我正在尝试通过 get-pip.py 安装 pip3,但我得到了
Traceback (most recent call last):
File "get-pip.py", line 19177, in <module>
main()
File "get-pip.py", line 194, in main
bootstrap(tmpdir=tmpdir)
File "get-pip.py", line 82, in bootstrap
import pip
zipimport.ZipImportError: can't decompress data; zlib not available
Run Code Online (Sandbox Code Playgroud)
它适用于安装的 Python 2.6.6。我在网上寻找答案,但似乎找不到适合我的答案。
编辑: yum search zlib
jzlib.i686 : JZlib re-implementation of zlib in pure Java
perl-Compress-Raw-Zlib.i686 : Low-Level Interface to the zlib compression library
perl-Compress-Zlib.i686 : A module providing Perl interfaces to the zlib compression library
perl-IO-Zlib.i686 : Perl IO:: style interface to Compress::Zlib
zlib.i686 : The zlib compression and decompression library
zlib-debuginfo.i686 : Debug information for package zlib
zlib-devel.i686 : Header files and libraries for Zlib development
perl-IO-Compress-Zlib.i686 : Perl interface to allow reading and writing of gzip and zip data
Name and summary matches only, use "search all" for everything.
Run Code Online (Sandbox Code Playgroud)
jmu*_*sch 140
Ubuntu 16.10+和 Python 3.7 开发
sudo apt-get install zlib1g-dev
Run Code Online (Sandbox Code Playgroud)
注意:我只把它放在这里是因为它是错误的最高搜索结果,但这解决了我的问题。
更新:ubuntu 14.04LTS 和 4.1+ 的基本内核也是如此
Knu*_*sen 46
解决办法是:# yum install zlib-devel
小智 8
只需复制粘贴此代码:
CFLAGS="-I$(brew --prefix readline)/include -I$(brew --prefix openssl)/include -I$(xcrun --show-sdk-path)/usr/include" \
LDFLAGS="-L$(brew --prefix readline)/lib -L$(brew --prefix openssl)/lib" \
PYTHON_CONFIGURE_OPTS=--enable-unicode=ucs2 \
pyenv install -v 3.6.0
Run Code Online (Sandbox Code Playgroud)
您没有解压工具,您应该安装zlib。
更新答案
首先检查是否已安装
yum list python-gzipstream
如果没有,则运行以下命令进行安装
yum install python-gzipstream.noarch
我的系统上安装了这个
yum list python-gzipstream
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.webwerks.com
* epel: ftp.kddilabs.jp
* extras: centos.webwerks.com
* updates: mirror.nbrc.ac.in
Available Packages
python-gzipstream.noarch 1.4.3-1.el6 epel
Run Code Online (Sandbox Code Playgroud)