我正在远程服务器上工作。当我尝试在虚拟环境中使用 pip 安装任何东西时,出现错误:
(venv) [barta@bivoj program]$ pip install -r requirements.txt
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting joblib==0.11 (from -r requirements.txt (line 1))
Could not fetch URL https://pypi.python.org/simple/joblib/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping
Python 2.7 一切正常。我可以自己解决这个问题(我没有 root 权限)还是需要联系管理员?
首先我在主文件夹中安装 python 3.6 时遇到了这个问题。我认为问题可能是因为它在我的主文件夹中,所以我要求全新安装 python 3.6。
我考虑过更改 setup.py 并在我家重新安装,正如 Claudio 在这里所建议的:
pip3 installs inside virtual environment with python3.6 failing due to ssl module not available
但我没有找到任何 openssl 文件夹。/usr/bin 中有 openssl,但那不是目录。我搜索了 ssl.h 文件,但没有在任何地方找到它。
最佳答案
听起来您是在没有 libssl-dev
的情况下从源代码构建 python。
运行:
sudo apt-get install libssl-dev
sudo ./configure
sudo make altinstall
关于python - 由于 ssl 错误,无法在 python 3.6 中 pip 安装包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43923085/