相关疑难解决方法(0)

我如何告诉 mkvirtualenv 我想使用哪个版本的 Python?

我对使用时安装的 Python 版本感到困惑mkvirtualenv。在任何 virtualenv 之外,这就是我所拥有的。

$ which python 
/opt/local/bin/python    << MacPorts installed Python
$ python -V
Python 2.7.13
$ python -c "import ssl; print ssl.OPENSSL_VERSION"
OpenSSL 1.0.2k  26 Jan 2017
Run Code Online (Sandbox Code Playgroud)

到目前为止还好。

现在,创建虚拟环境...

$ mkvirtualenv foo
[normal stuff here]
(foo) $ which python
/Users/me/Workspace/venvs/foo/bin/python
(foo)$ python -V
Python 2.7.10
Run Code Online (Sandbox Code Playgroud)

为什么这个 python 是 2.7.10?而不是 python 2.7.13?

$ python -c "import ssl; print ssl.OPENSSL_VERSION"
OpenSSL 0.9.8zh 14 Jan 2016
Run Code Online (Sandbox Code Playgroud)

这是从哪里来的?

我如何知道mkvirtualenv我想使用哪个版本的 Python?

virtualenv virtualenvwrapper python-2.7

5
推荐指数
1
解决办法
4248
查看次数

标签 统计

python-2.7 ×1

virtualenv ×1

virtualenvwrapper ×1