我使用的是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
当前回答
在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
其他回答
对于未来试图解决这个问题的Oracle Linux用户,下面是对我有用的方法。 首先安装缺少的库:
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel
readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
然后cd到Python3。X库并运行:
make
make install
对于Debian用户,以下可能会用到:
sudo apt install libssl-dev libncurses5-dev libsqlite3-dev libreadline-dev libtk8.6 libgdm-dev libdb4o-cil-dev libpcap-dev
然后cd到Python 3. exe文件所在的文件夹。X库源代码,运行:
./configure
make
make install
你可以尝试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"
操作系统一样,pyenv
如果你的python是pyenv安装的,其中pyenv是在macOS上安装的,可能有一个更新的版本可以修复这个问题:
$ brew update && brew upgrade pyenv
然后重新安装python版本:
$ pyenv install 3.7.2
pyenv: /Users/luckydonald/.pyenv/versions/3.7.2 already exists
continue with installation? (y/N)
注意,像这样覆盖现有的python安装有点脏,但在我的例子中,它确实有效。可能更干净的方法是删除它,然后正确地重新创建。
为我工作。
pkg install openssl
使用此选项可以启用ssl。