David
David

Reputation: 1569

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

**

Upvotes: 0

Views: 5076

Answers (3)

HelloWorld
HelloWorld

Reputation: 69

pip install -U pip

After searching around for quite long, I tried this.

Upvotes: 0

Anupam
Anupam

Reputation: 15620

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

Upvotes: 2

Taylor
Taylor

Reputation: 1253

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

Upvotes: 0

Related Questions