gpt4 book ai didi

pip3 在虚拟环境中安装,由于 ssl 模块不可用,python3.6 失败

转载 作者:行者123 更新时间:2023-12-03 07:23:59 24 4
gpt4 key购买 nike

(py36venv) vagrant@pvagrant-dev-vm:/vagrant/venvs$ pip3 install pep8

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

Collecting pep8 Could not fetch URL https://pypi.python.org/simple/pep8/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping

Could not find a version that satisfies the requirement pep8 (from versions: ) No matching distribution found for pep8

背景信息 - 尝试迁移到 python 3.6。

使用以下命令安装 python3.6:

wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz

tar -xvf Python-3.6.0.tgz

cd Python-3.6.0
./configure --enable-optimizations
make -j8 sudo make altinstall python3.6

创建虚拟环境:

python3.6 -m venv py36venv

source py36venv/bin/activate

尝试安装pep8

(py36venv) pip3 install pep8

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Collecting pep8

Could not fetch URL https://pypi.python.org/simple/pep8/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the

SSL module is not available. - skipping Could not find a version that satisfies the requirement pep8 (from versions: ) No matching distribution found for pep8

最佳答案

我按照以下步骤在 ubuntu 14.04 中安装 python3.6,并且 virtualenv pip 安装工作正常。

Python 3.6 安装:

sudo apt-get install python3-dev libffi-dev libssl-dev
wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz
tar xvf Python-3.6.0.tgz
cd Python-3.6.0
./configure --enable-optimizations
make -j8
sudo make altinstall
python3.6

如果看到以下错误 --

zipimport.ZipImportError: can't decompress data; zlib not available make: *** [altinstall] Error 1

尝试:

sudo apt-get install zlib1g-dev

验证:

在python3.6中创建virtualenv:

python3.6 -m venv testenv
source testenv/bin/activate
pip install pep8

使用 pip :

(testenv) vagrant@pvagrant-dev-vm:~$ pip install pep8
*Collecting pep8
Downloading pep8-1.7.0-py2.py3-none-any.whl (41kB)
100% |████████████████████████████████| 51kB 4.1MB/s
Installing collected packages: pep8
Successfully installed pep8-1.7.0*

(testenv) vagrant@pvagrant-dev-vm:~$ pip list

pep8 (1.7.0)
pip (9.0.1)
setuptools (28.8.0)

关于pip3 在虚拟环境中安装,由于 ssl 模块不可用,python3.6 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41489439/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com