在虚拟环境中指定Python版本

2024-04-19 07:29:28 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经在/usr/bin/python3.6安装了python3.6,我正在尝试使用这个版本的python创建一个virtualenv。你知道吗

我试过virtualenv --python=/usr/bin/python3.6 testenv 然后我用source testenv/bin/activate激活了virtualenv 但是,当我打开python shell时,它显示版本是2.7.12

下面是一个截图 enter image description here

如果virtualenv被激活,那么它不应该使用python3.6吗?我错过了什么?你知道吗


Tags: 版本sourcebinvirtualenvusrshellactivatetestenv