1

On my Mac OS, I have installed python 2.7.15 because it is required for a project.

Then in the project folder, I have created virtual environment virtualenv -p /usr/local/bin/python venv and activated it

Now python -V Python 2.7.15

pip -V pip 10.0.1 from /Users/.../Work/.../venv/lib/python2.7/site-packages/pip (python 2.7)

I try to install the project: pip install myProject but it fails with this error: pip is configured with locations that require TLS/SSL, however, the SSL module in Python is not available.

Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)':

If I use python and pip, not from venv everything works properly. How to configure SSL in python in Virtual Environment on Mac OS?

Harish
  • 425
  • 7
  • 22
  • Can you refer this thread for the same error on python3 https://stackoverflow.com/questions/45954528/pip-is-configured-with-locations-that-require-tls-ssl-however-the-ssl-module-in or https://stackoverflow.com/questions/41489439/pip3-installs-inside-virtual-environment-with-python3-6-failing-due-to-ssl-modul?rq=1 – devssh Sep 25 '18 at 10:06
  • But I use python 2.7.15 and all of that answers didn't help – Евгений Коптюбенко Sep 25 '18 at 10:09
  • You need to install the SSL module in a similar way to that described in the questions. Try using `pip install` or `brew install` instead of `apt-get` for ubuntu or `yum install` in centos. The question has answers for mac with brew install as well. `brew install openssl` `brew unlink openssl && brew link openssl --force` – devssh Sep 25 '18 at 10:10
  • When I try installation of any library it fails: pip install libssl-dev pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Collecting libssl-dev Could not fetch URL https://pypi.org/simple/libssl-dev/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/libssl-dev/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)) - skipping Could not find a version that satisfies the requirement libssl-dev (from versions: – Евгений Коптюбенко Sep 25 '18 at 10:19
  • This can be solved by https://stackoverflow.com/questions/1534210/use-different-python-version-with-virtualenv/11301911#11301911. Check this answer for full details https://stackoverflow.com/a/42215204/3737468 – devssh Sep 25 '18 at 10:24
  • I tried to do brew install openssl brew unlink openssl && brew link openssl --force, but it made no result. Brew doesn't have anything in common with virtual environments – Евгений Коптюбенко Sep 25 '18 at 10:24
  • @devssh I have already searched stackoverflow and Google. Thank you for your googling. But there is no answer for my situation – Евгений Коптюбенко Sep 25 '18 at 10:31
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/180726/discussion-between-devssh-and--). – devssh Sep 25 '18 at 10:44
  • I have solved it recreating virtual environment. – Евгений Коптюбенко Sep 25 '18 at 10:57

0 Answers0