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

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

当前回答

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

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

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

其他回答

正如Tokci所说,它也适用于Windows 7。

用鼠标移动到Windows图标(左下),并开始输入“Anaconda”。应该会显示一些匹配的条目。选择“Anaconda Prompt”。一个名为“蟒蛇提示”的新命令窗口将打开。

然后pip开始工作。

以下也有助于导入xgboost: https://www.youtube.com/watch?v=05djBSOs1FA

你可以尝试brew链接,它会告诉你正确的说明:

$ brew link openssl --force
Warning: Refusing to link macOS provided/shadowed software: openssl@1.1
If you need to have openssl@1.1 first in your PATH run:
  echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc

For compilers to find openssl@1.1 you may need to set:
  export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
  export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"

For pkg-config to find openssl@1.1 you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig"

我遇到了这个问题!我不小心安装了32位版本的Miniconda3。确保你选择的是64位版本!

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

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

先安装openssl。

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