加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

如何在Windows上使用python 2.6安装pip

发布时间:2020-12-14 01:35:46 所属栏目:Windows 来源:网络整理
导读:我试图在我的开发机器上安装带有 python 2.6的pip,试图匹配也使用python 2.6的部署环境. Python 2.6安装好了.我尝试使用https://pip.pypa.io/en/stable/installing/中所述的get-pip.py安装pip,其中包含https://bootstrap.pypa.io/2.6/get-pip.py版本的get-pi
我试图在我的开发机器上安装带有 python 2.6的pip,试图匹配也使用python 2.6的部署环境.

Python 2.6安装好了.我尝试使用https://pip.pypa.io/en/stable/installing/中所述的get-pip.py安装pip,其中包含https://bootstrap.pypa.io/2.6/get-pip.py版本的get-pip.py脚本

但是它失败了以下内容:

C:usersme> 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
Collecting pip<10
c:usersmeappdatalocaltemptmpcdimtdpip.zippip_vendorurllib3utilssl_.py:339: SNIMissingWarning: An HTTPS request has been made,but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate,which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information,see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
c:usersmeappdatalocaltemptmpcdimtdpip.zippip_vendorurllib3utilssl_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information,see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  Retrying (Retry(total=4,connect=None,read=None,redirect=None,status=None)) after connection broken by 'SSLError(SSLError(1,'_ssl.c:490: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/
c:usersmeappdatalocaltemptmpcdimtdpip.zippip_vendorurllib3utilssl_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information,see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  Retrying (Retry(total=3,see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  Retrying (Retry(total=2,see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  Retrying (Retry(total=1,see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  Retrying (Retry(total=0,see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  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(SSLError(1,)) - skipping
  Could not find a version that satisfies the requirement pip<10 (from versions: )
No matching distribution found for pip<10

显然,升级到更新的python失败了我的目的.

建议警告InsecurePlatformWarning的URL建议使用pip安装更多内容…>.< PS我也尝试过使用setuptools-40.0.0中的easy-install,但我无法使用它.我不确定我是否正确使用它,因为setuptools安装文档有循环链接(从文档到Pypi,回到文档)

解决方法

对于Python 2.6,您需要较旧的setuptools.适用于Python 2.6的最后一个setuptools版本是 36.8.

下载setuptools-36.8.0.zip,解压缩并运行python2.6 setup.py install.

之后get-pip.py应该为你安装点子.

支持Python 2.6的pip的最后一个版本是9.0.3:https://pypi.org/project/pip/9.0.3/#files

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读