1

I am trying to install python virtualenv on my mac, but every time I do:

$ pip install virtualenv

I get:

Collecting virtualenv
Could not fetch URL https://pypi.python.org/simple/virtualenv/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:661) - skipping
Could not find a version that satisfies the requirement virtualenv (from versions: )
No matching distribution found for virtualenv

I've been through a lot of pages reading and trying stuff, but none of those solved the problem. So I decided to ask here.

Have you guys been there? What did you do to get it installed and working?

Marcus Vinicius Melo
  • 1,118
  • 16
  • 23
  • What version of `pip`? There is a macOS OpenSSL issue with the new [Python warehouse](https://pyfound.blogspot.com/2018/03/warehouse-all-new-pypi-is-now-in-beta.html#Migrating), so you might have to upgrade `pip` to `9.0.3+` with `curl https://bootstrap.pypa.io/get-pip.py | python` – user May 11 '18 at 15:42
  • It's pip 9.0.1 and the mac is on version 10.13.4 – Marcus Vinicius Melo May 11 '18 at 16:08
  • Possible duplicate of [pip install fails for every package ("Could not find a version that satisfies the requirement")](https://stackoverflow.com/questions/49748063/pip-install-fails-for-every-package-could-not-find-a-version-that-satisfies-th) – phd May 11 '18 at 20:25

1 Answers1

3

If you are running on macOS 10.12+ and an older version of pip (< 9.0.3), you might be running into the TLS1.2 issue mentioned in the Python warehouse blog entry. To solve this, you need to update pip to 9.0.3+ by running:

curl https://bootstrap.pypa.io/get-pip.py | python
user
  • 4,651
  • 5
  • 32
  • 60