我使用的是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
当前回答
修复此问题,无需更改任何与TSL/SSL相关的内容。
我试着看看同样的事情是否发生在皮普身上,看到皮普被打破了。我做了一些调查,发现这可能是由于Homebrew在2020年2月1日删除了python@2造成的。
运行brew uninstall python@2,删除Homebrew安装的python2。
销毁了使用python3创建的虚拟环境,并创建了一个新的。Pip3安装工作再次正常。
其他回答
对于未来试图解决这个问题的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
苹果操作系统
我在Mac OS(Mojave)上遇到了同样的问题,并解决了这个链接中提到的问题- Openssl问题。
如果你没有Homebrew或不知道什么是Homebrew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
或者如果你已经安装了Homebrew:
brew update && brew upgrade
brew uninstall --ignore-dependencies openssl; brew install https://github.com/tebelorg/Tump/releases/download/v1.0.0/openssl.rb
更新: 请记住,我必须使用——ignore-dependencies标记,因为安装的其他包依赖于OpenSSL。
另外,如果问题是在使用pyenv后引起的,您可以通过使用以下方法修复:
brew reinstall python
修复此问题,无需更改任何与TSL/SSL相关的内容。
我试着看看同样的事情是否发生在皮普身上,看到皮普被打破了。我做了一些调查,发现这可能是由于Homebrew在2020年2月1日删除了python@2造成的。
运行brew uninstall python@2,删除Homebrew安装的python2。
销毁了使用python3创建的虚拟环境,并创建了一个新的。Pip3安装工作再次正常。
我也有同样的问题,这是因为我改变了环境的文件夹。 我只是移除了env,重新安装了所有东西。