【发布时间】:2017-07-07 12:33:22
【问题描述】:
我有 CentOS 6 和下面的 python:
默认值:
[root@localhost vagrant]# python
Python 2.6.6 (r266:84292, Jan 22 2014, 09:42:36)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
自定义:
[root@localhost vagrant]# python2.7
Python 2.7.13 (default, Jul 7 2017, 12:01:53)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
当我尝试使用 Python2.7 安装 pip 时出现以下错误:
[root@localhost vagrant]# python2.7 get-pip.py
Traceback (most recent call last):
File "get-pip.py", line 20061, 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
如果安装是通过 yum 完成的(我想使用默认 python),那么 pip 会成功安装,但我在通过 pip 安装任何模块时遇到问题,错误:InsecurePlatformWarning 并建议进行python升级。 如何解决这个问题,并且有一些人面临类似的问题?
【问题讨论】:
-
通过 yum 升级 python 有效吗?
-
解决了...下面帮助...stackoverflow.com/questions/12344970/…谢谢大家...