gpt4 book ai didi

python - Virtualenv pip ssl - 尝试安装任何包时失败。错误 : "ssl module in Python is not available"

转载 作者:太空宇宙 更新时间:2023-11-04 02:44:37 29 4
gpt4 key购买 nike

我是 virtualenv 的新手,并试图让它工作,以便与给定的项目一起工作。我关注了this指南进行设置。我一进入 virtualenv,pip 就停止工作并出现上述错误。

这里的确切问题是:

(virtual-env) $ pip install --trusted-host pypi.python.org Django==1.11.4
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting Django==1.11.4
Could not fetch URL https://pypi.python.org/simple/django/: 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 Django==1.11.4 (from versions: )
No matching distribution found for Django==1.11.4

...是的...--trusted-host 没什么区别...看起来,因为它需要一些我找不到的包。

版本:

  • python

    $ python --version
    Python 3.6.2
  • pip 数

    $ pip --version # <- Edited
    pip 9.0.1

我确实尝试安装 ssl 模块,但无济于事。原来你不能用 python 3 安装 ssl。问题是打印语法。

  [...]
File "/tmp/pip-build-undfmh27/ssl/setup.py", line 33
print 'looking for', f
^
SyntaxError: Missing parentheses in call to 'print'

感谢任何帮助

最佳答案

好吧...事实证明,使用 python 3.6 安装东西的特定顺序。这post很有帮助。

正在关注 this instructions 我能够让我的 virtualenv 按预期工作。

总结一下。如题中安装python 3.6.2前,需要准备如下环境:

$ sudo apt-get install build-essential checkinstall
$ sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

然后,安装 python 3,并在 virtualenv 中使用它。

关于python - Virtualenv pip ssl - 尝试安装任何包时失败。错误 : "ssl module in Python is not available",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45496373/

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