我使用的是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
当前回答
为我工作。
sudo apt-get install libssl-dev
使用此选项为pip启用ssl。 如果有人遇到问题请告诉我。
其他回答
我也有同样的问题,这是因为我改变了环境的文件夹。 我只是移除了env,重新安装了所有东西。
Windows 10 如果你想在正常的cmd中使用pip,而不仅仅是在Anaconda提示符中。您需要添加3个环境路径。 比如:
D:\Anaconda3
D:\Anaconda3\Scripts
D:\Anaconda3\Library\bin
大多数人只添加D:\Anaconda3\Scripts
为我工作。
pkg install openssl
使用此选项可以启用ssl。
进入Anaconda提示符并输入(如果你有python3。X安装在你的引擎上):
py -m pip install pymysql
我也有同样的问题,这个解决了我的问题。之后,您可以在power shell或任何其他提示符中导入pymysql。
对于未来试图解决这个问题的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