pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available

I am using Python 3.6. When I try to install "modules" using pip3, I face this issue:

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available

Solution 1:

For Windows 10 if you want use pip in normal cmd, not only in Anaconda prompt. you need add 3 environment paths. like the followings:

D:\Anaconda3 
D:\Anaconda3\Scripts
D:\Anaconda3\Library\bin 

most people only add D:\Anaconda3\Scripts

Solution 2:

MAC OS

I had the same problem on Mac OS(Mojave) and solved the problem as mentioned on this link - Openssl issue.

  1. If you do not have Homebrew or don't know what is Homebrew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  1. Or if you already have Homebrew installed:
brew update && brew upgrade
brew uninstall --ignore-dependencies openssl; brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb

Update: Keep in mind, that I had to use --ignore-dependencies flag, because other packages installed that depend on OpenSSL.

Additional if the problem is caused after using pyenv, you can fix it by using:

brew reinstall python