' pip install'错误:InsecurePlatformWarning

时间:2016-05-11 17:01:30

标签: python macos python-2.7 pip

每当我尝试通过终端(最近的Yelp API Python包)使用pip install时,我得到:

Macintosh:~ Ryan$ pip install yelp
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pip-7.1.0-py2.6.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Collecting yelp
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pip-7.1.0-py2.6.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pip-7.1.0-py2.6.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Could not find a version that satisfies the requirement yelp (from versions: )
No matching distribution found for yelp

当我用sudo尝试时,我得到类似的东西,包括:

  

目录' / Users / Ryan / Library / Caches / pip / http'或其父目录不归当前用户所有,并且已禁用缓存。请检查该目录的权限和所有者。如果用sudo执行pip,你可能需要sudo' -H标志。

当我查找InsecurePlatformWarning时,它会告诉我升级Python(我已经完成了)但是当我运行pip install --upgrade ndg-httpsclient时,我得到了相同的InsecurePlatformWarning错误。< / p>

如果我尝试使用pip升级pip install --upgrade pip(因为终端也说&#34;您正在使用pip版本7.1.2,但版本8.1.2可用。&#34;) ,我也得到错误:

  

异常:回溯(最近一次调用最后一次):文件   &#34; /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pip-7.1.0-py2.6.egg/pip/basecommand.py" ;,   第223行,主要       status = self.run(options,args)File&#34; /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pip-7.1.0-py2.6.egg/ PIP /命令/ install.py&#34 ;,   第282行,在运行中       requirement_set.prepare_files(finder)File&#34; /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pip-7.1.0-py2.6.egg/pip/req/ req_set.py&#34;,

     

似乎对我来说问题是pip仍在使用Python 2.6,但即使我已升级,我也无法让pip识别它。例如:

Macintosh:~ Ryan$ python -V
Python 2.6.4
Macintosh:~ Ryan$ python2.7 -V
Python 2.7.10
Macintosh:~ Ryan$ python3.4 -V
Python 3.4.1
Macintosh:~ Ryan$ python3.5 -V
Python 3.5.1

我是Python的新手,但我对2更感觉更舒服而不是3.有关如何解决所有问题的建议吗?

Macintosh:~ Ryan$ pip -V
pip 7.1.0 from /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pip-7.1.0-py2.6.egg (python 2.6)

1 个答案:

答案 0 :(得分:0)

感谢聊天中的I'L'I - 我必须在sudo chown -R Ryan "/Users/Ryan/Library/Caches/pip/http''更改我的权限,然后重新安装get-pip.py