简体   繁体   English

Python点不能安装任何东西

[英]Python pip cannot install anything

I am trying to install pandas with pip. 我正在尝试使用pip安装熊猫。

sudo pip install pandas

And I am getting the following error: 我收到以下错误:

➜  ~ which python
/usr/bin/python

➜  ~ python --version
Python 2.7.10

➜  ~ sudo pip install pandas
The directory '/Users/bdisha/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/bdisha/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pandas
  Could not fetch URL https://pypi.python.org/simple/pandas/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) - skipping
  Could not find a version that satisfies the requirement pandas (from versions: )
No matching distribution found for pandas

What am I doing wrong? 我究竟做错了什么?

** **

PS: Note that the same happens within a virtual environment PS:请注意,在虚拟环境中也会发生同样的情况

** **

This is due to the recent TLS deprecation for Python.org sites. 这是由于最近对Python.org网站的TLS弃用。

This answer has the details. 这个答案有细节。

To summarize, upgrade pip as follows: 总而言之,请按以下方式升级点子:

curl https://bootstrap.pypa.io/get-pip.py | python

and then run: 然后运行:

pip install pandas

I would try sudo chown -R your_user_name /Users/bdisha/Library/Caches/pip/http and chown -R your_user_name /Users/bdisha/Library/Caches/pip 我会尝试sudo chown -R your_user_name / Users / bdisha / Library / Caches / pip / http和chown -R your_user_name / Users / bdisha / Library / Caches / pip

This post may be useful 这篇文章可能有用

pip install -U pip

搜寻了很长一段时间后,我尝试了这个

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM