Python 2.6.6安装pip

admin

发表文章数:3151

首页 » 网络资源 » 正文

根据pip官网说明,使用get-pip.py安装失败。

官网说明Note

The get-pip.py script is supported on the same python version as pip. For the now unsupported Python 2.6, alternate script is available here.

下载get-pip.py

curl https://bootstrap.pypa.io/2.6/get-pip.py -o get-pip.py

安装pip

注意:使用python2.6.6安装,因为我的环境中python指向的是2.6.6,所以直接使用下面命令进得安装。

python get-pip.py

报错如下

[root@javen-zhao pip2.6]# python get-pip.py 

DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

Collecting pip<10

  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/pip/

  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/pip/

  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/pip/

  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/pip/

  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/pip/

  Could not fetch URL https://pypi.python.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)) – skipping

  Could not find a version that satisfies the requirement pip<10 (from versions: )

No matching distribution found for pip<10

根据网上方法安装python时使用./configure –with-ssl也不行。经过多次尝试,使用如下命令安装python 2.6.6后可以正常安装pip。

./configure –prefix=/usr/local –with-ssl –enable-optimizations

其中–prefix=/usr/local是指定python安装的路径,安装后python2.6可执行脚本会在/usr/local/bin目录下

注意:做上面操作时检查一下系统中是否有安装openssl-devel

检查openssl安装情况

[root@javen-zhao pip]# rpm -aq|grep openssl

openssl-devel-1.0.1e-57.el6.x86_64

openssl-1.0.1e-57.el6.x86_64

 

如果没有openssl-devel使用yum 安装

[root@javen-zhao pip]# yum install openssl-devel

重新安装pip,安装成功后查看2.6.6环境下的pip版本信息

[root@javen-zhao pip2.6]# pip2.6 -V

pip 9.0.3 from /usr/local/lib/python2.6/site-packages (python 2.6)

[root@javen-zhao pip2.6]# whereis pip

pip: /usr/bin/pip /usr/bin/pip2.7 /usr/local/bin/pip2.6 /usr/local/bin/pip

安装成功。

——————— 

作者:凌襄公子 

来源:CSDN 

原文:https://blog.csdn.net/weixin_42124014/article/details/85050241 

版权声明:本文为博主原创文章,转载请附上博文链接!

未经允许不得转载:作者:admin, 转载或复制请以 超链接形式 并注明出处 夜河资源网
原文地址:《Python 2.6.6安装pip》 发布于2019-08-19

分享到:
赞(0) 打赏

评论 抢沙发

8 + 3 =


撰写不易~如果您觉得文章对您有帮助的话可以打赏我哦~谢谢亲亲~

支付宝扫一扫打赏

微信扫一扫打赏

外服网游加速器破解版
包含腾讯网游加速器、海豚网游加速器等八款知名加速器,可加速外服游戏,永久包售后包更新,不定时添加新款破解版加速器!
切换注册

登录

忘记密码 ?

切换登录

注册