新聞中心
安裝pip失?。?/strong>

創(chuàng)新互聯(lián)2013年開創(chuàng)至今,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項(xiàng)目成都網(wǎng)站設(shè)計(jì)、成都網(wǎng)站建設(shè)網(wǎng)站策劃,項(xiàng)目實(shí)施與項(xiàng)目整合能力。我們以讓每一個(gè)夢(mèng)想脫穎而出為使命,1280元大寧做網(wǎng)站,已為上家服務(wù),為大寧各地企業(yè)和個(gè)人服務(wù),聯(lián)系電話:13518219792
注意:使用python2.6.6安裝,因?yàn)槲业沫h(huán)境中python指向的是2.6.6,所以直接使用下面命令進(jìn)得安裝。
python get-pip.py
報(bào)錯(cuò)如下
[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
解決方法:
1、使用如下命令安裝python 2.6.6后可以正常安裝pip。
./configure --prefix=/usr/local --with-ssl --enable-optimizations
其中--prefix=/usr/local是指定python安裝的路徑,安裝后python2.6可執(zhí)行腳本會(huì)在/usr/local/bin目錄下
2、做上面操作時(shí)檢查一下系統(tǒng)中是否有安裝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
3、 如果沒有openssl-devel使用yum 安裝
[root@javen-zhao pip]# yum install openssl-devel
4、重新安裝pip,安裝成功后查看2.6.6環(huán)境下的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
安裝成功。
分享文章:創(chuàng)新互聯(lián)Python教程:python2.6pip安裝失敗
URL地址:http://fisionsoft.com.cn/article/dpscoic.html


咨詢
建站咨詢
