gpt4 book ai didi

python - 无法在 virtualenv 中使用 pip 安装软件包

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

我尝试在虚拟环境中使用 pip 安装各种 python 软件包,但无法安装。如果我尝试不在虚拟环境中安装相同的软件包,那么它就会被安装。每次我都会遇到不同的错误。我将安装 scrapy 时遇到的错误之一粘贴到下面。

Command "/home/namita/venv/bin/python -c "import setuptools, tokenize;file='/tmp/pip-build-AHL0d8/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-Dk98DU-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/namita/venv/include/site/python2.7/cffi" failed with error code 1 in /tmp/pip-build-AHL0d8/cffi

我还收到下面提到的警告:

/home/namita/venv/local/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning

我尝试访问https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning但并不满足。

最佳答案

I tried visiting https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning but was not satisfied.

解决方案非常明确:

If you encounter this warning, it is strongly recommended you upgrade to a newer Python version, or that you use pyOpenSSL as described in the OpenSSL / PyOpenSSL section.

如果您不想升级 Python 版本 (>2.7.9),请安装以下软件包:

$ pip install pyopenssl ndg-httpsclient pyasn1

它已被证明可以解决其他类似问题:

关于python - 无法在 virtualenv 中使用 pip 安装软件包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31334914/

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