我使用的是Python 3.6。当我尝试使用pip3安装“模块”时,我遇到了这个问题:
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available
我使用的是Python 3.6。当我尝试使用pip3安装“模块”时,我遇到了这个问题:
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available
当前回答
我在使用Ubuntu、pyenv和pyenv管理的Python 3.8.1时遇到了这个问题。实际上没有办法让pip正确工作,因为每次我试图安装任何东西,包括pip本身,都会出现相同的错误。 最终的解决方案是通过pyenv安装一个更新的版本,在本例中是3.8.6。显然,从3.8.4开始,Python已经准备好开箱运行SSL/TLS,所以一切都很好。
其他回答
你可以尝试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"
目前在Windows 10上的Anaconda提示符(Anaconda3)也有同样的问题。这里是解决方案:https://github.com/ContinuumIO/anaconda-issues/issues/10576
在我的例子中,我重新安装了Python。这就解决了问题。
brew reinstall python
在Windows 10 SQL Server 19中,解决方案是已知的。
复制以下文件:
libssl-1_1-x64.dll libcrypto-1_1-x64.dll
从文件夹中
C:\Program Files\Microsoft SQL Server\MSSSQL15。MSSQLSERVER \ PYTHON_SERVICES \图书馆\ bin
到文件夹
C:\Program Files\Microsoft SQL Server\MSSSQL15。MSSQLSERVER \ PYTHON_SERVICES \ dll
然后打开一个新的DOS命令shell提示符。
从https://learn.microsoft.com/en-us/sql/machine-learning/troubleshooting/known-issues-for-sql-server-machine-learning-services?view=sql-server-ver15 # 7 -不-安装- python包-使用- pip -后-安装- sql - server - windows - 2019
我用的是macOS,我用过brew,但Vaulstein在他的回答中提到的并没有涵盖我的情况。
我运行以下命令,以确保我当前的python没有通过brew安装
brew list | grep python
python
python@2
brew info python
python@3.8: stable 3.8.3 (bottled)
Interpreted, interactive, object-oriented programming language
https://www.python.org/
Not installed
...
所以我从https://www.python.org/下载了最新的3.8.5,安装时我看到了以下信息
证书验证和OpenSSL 此包包含自己的私有OpenSSL 1.1.1副本。的 管理的系统和用户密钥链中的信任证书 Python ssl模块不默认使用Keychain Access应用程序和安全命令行实用程序
在安装3.8.5之后,它修复了这个问题。