在Windows上安装Python 2.7.8的pip

4

我想要安装Python 2.7.8下的pip模块,这是arcGIS为你安装的版本。

我正在使用引导方法安装pip,但在运行命令提示符中的get-pip.py时遇到了错误。

我得到了以下错误信息:

Warning (from warnings module):   File
"c:\users\vlaw\appdata\local\temp\tmpzamnrk\pip.zip\pip\_vendor\requests\packages\urllib3\util\ssl_.py",
line 122 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/security.html#insecureplatformwarning.
Could not fetch URL https://pypi.python.org/simple/pip/: There was a
problem confirming the ssl certificate: [Errno 1] _ssl.c:510:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate
verify failed - skipping Requirement already up-to-date: pip in
c:\esripyfldr\arcgis10.3 Collecting setuptools

Warning (from warnings module):   File
"c:\users\vlaw\appdata\local\temp\tmpzamnrk\pip.zip\pip\_vendor\requests\packages\urllib3\util\ssl_.py",
line 122 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/security.html#insecureplatformwarning.
Could not fetch URL https://pypi.python.org/simple/setuptools/: There
was a problem confirming the ssl certificate: [Errno 1] _ssl.c:510:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate
verify failed - skipping [31m  Could not find a version that
satisfies the requirement setuptools (from versions: )

我正在使用公司提供的网络。您认为防火墙是导致出现错误的原因吗?


你为什么使用2.7版本?有特定的目的吗?你可以使用3.0版本,它默认安装了pip,所以不会有任何问题。 - whatsinthename
我的Python是由ArcGIS软件安装的。Python 2.7.8是唯一与该软件兼容的版本。我不知道。 - Vincent Law
2个回答

2

由于你在防火墙内部并且从防火墙外部安装文件,因此你需要设置代理。

Ubuntu

export http_proxy="http://<<username>>:<<password>>@<<proxy server>>:<<proxy_port>>"
export https_proxy="https://<<username>>:<<password>>@<<proxy server>>:<<proxy_port>>"

Windows:

set HTTP_PROXY=http://<<username>>:<<password>>@<<proxy server>>:<<proxy_port>>
set HTTPS_PROXY=https://<<username>>:<<password>>@<<proxy server>>:<<proxy_port>>

1
当我运行命令时,我需要更改用户名、密码和代理端口吗? - Vincent Law
1
@VincentLaw 是的,这通常是 < > 的意思。 - Code-Apprentice

0

我认为你应该先下载get-pip.py,然后运行python get-pip.py

如果这不起作用,请使用python get-pip.py --prefix=/usr/local/

希望这能帮到你。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接