我是 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.2pip 数
$ 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 中使用它。
