简体   繁体   中英

Python pip cannot install anything

I am trying to install pandas with 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

**

This is due to the recent TLS deprecation for Python.org sites.

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

This post may be useful

pip install -U pip

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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