gpt4 book ai didi

python - 获取 ImportError : cannot import name HTTPSHandler during creation of virtual environment

转载 作者:太空宇宙 更新时间:2023-11-03 11:52:55 24 4
gpt4 key购买 nike

我有一个 Raspbery Pi,我通过执行以下操作将其升级到 Python 3.3.3:

sudo apt-get install build-essential libsqlite3-dev sqlite3 bzip2 libbz2-dev
wget http://www.python.org/ftp/python/3.3.3/Python-3.3.3.tar.bz2
tar jxf ./Python-3.3.3.tar.bz2
cd ./Python-3.3.3
./configure --prefix=/opt/python3.3.3
make && sudo make install

但是在执行之后:virtualenv -p/opt/python3.3.3/bin/python3.3 python3.3.3

我收到此错误消息:

Running virtualenv with interpreter /opt/python3.3.3/bin/python3.3
Using base prefix '/opt/python3.3.3'
New python executable in python3.3.3/bin/python3.3
Also creating executable in python3.3.3/bin/python
Installing setuptools, pip...
Complete output from command /home/pi/venv/python3.3.3/bin/python3.3 -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.2/dist-packages/virtualenv_support/pip-1.5.1-py2.py3-none-any.whl/pip/__init__.py", line 10, in <module>
File "/usr/local/lib/python3.2/dist-packages/virtualenv_support/pip-1.5.1-py2.py3-none-any.whl/pip/util.py", line 18, in <module>
File "/usr/local/lib/python3.2/dist-packages/virtualenv_support/pip-1.5.1-py2.py3-none-any.whl/pip/_vendor/distlib/version.py", line 14, in <module>
File "/usr/local/lib/python3.2/dist-packages/virtualenv_support/pip-1.5.1-py2.py3-none-any.whl/pip/_vendor/distlib/compat.py", line 66, in <module>
ImportError: cannot import name HTTPSHandler
----------------------------------------
...Installing setuptools, pip...done.
Traceback (most recent call last):
File "/usr/local/lib/python3.2/dist-packages/virtualenv.py", line 2338, in <module>
main()
File "/usr/local/lib/python3.2/dist-packages/virtualenv.py", line 824, in main
symlink=options.symlink)
File "/usr/local/lib/python3.2/dist-packages/virtualenv.py", line 992, in create_environment
install_wheel(to_install, py_executable, search_dirs)
File "/usr/local/lib/python3.2/dist-packages/virtualenv.py", line 960, in install_wheel
'PIP_NO_INDEX': '1'
File "/usr/local/lib/python3.2/dist-packages/virtualenv.py", line 902, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /home/pi/venv/python3.3.3/bin/python3.3 -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip failed with error code 1

最佳答案

像 Giorgio 提到的那样,我在构建 2.7 时也遇到了这个问题。 user3301335 完全正确——在构建 python 时,可以编译具有库依赖项的可选模块。

为了节省人们挖掘评论的时间,解决方案是在您的操作系统上安装 SSL 开发包。 APT 包的名称类似于 libssl-dev;在 Red Hat 上,它看起来像 openssl-devel

关于python - 获取 ImportError : cannot import name HTTPSHandler during creation of virtual environment,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21726499/

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