我使用的是Python 3.6。当我尝试使用pip3安装“模块”时,我遇到了这个问题:

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

当前回答

在尝试自己编译python后,仍然缺乏ssl模块,我最终尝试从apt安装缺少的模块,就像这样:

安装python3-openssl

其他回答

先安装openssl。

如果你在conda环境中遇到这个问题,你可以安装openssl 使用conda install -c anaconda openssl。它为您启用ssl !

Windows 10, Windows 7 如果pip install在CMD提示符下不工作,使用Anaconda提示符运行它-它工作。

https://github.com/pypa/virtualenv/issues/1139

Windows 10 如果你想在正常的cmd中使用pip,而不仅仅是在Anaconda提示符中。您需要添加3个环境路径。 比如:

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

大多数人只添加D:\Anaconda3\Scripts

为我工作。

sudo apt-get install libssl-dev

使用此选项为pip启用ssl。 如果有人遇到问题请告诉我。

如果有人使用Arch Linux操作系统,我通过运行这个解决了TLS/SSL问题:

sudo pacman -S openssl

然后我可以使用pip来安装我需要的包:

pip install openpyxl