[英]Virtualwrapper needs the full python3 path
In order to avoid to sudo pip3 install virtualwrapper have installed virtualwrapper on my Ubuntu with apt: 为了避免sudo pip3的安装,请使用apt在我的Ubuntu上安装virtualwrapper:
sudo apt-get install virtualenv virtualenvwrapper
When I only use the following command I do get a python 2.7 environment: 当我仅使用以下命令时,确实获得了python 2.7环境:
mkvirtualenv test mkvirtualenv测试
In order to make a python3 environment the following commando do not work: 为了创建python3环境,以下命令无法使用:
test@tester:~$ mkvirtualenv -p python3 test
The executable /home/test/python3 (from --python=/home/test/python3) does not exist
I order to have a python3 environement I have to use the following commando: 我要拥有一个python3环境,必须使用以下突击队:
mkvirtualenv -p /usr/bin/python3 py3
Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/test/.vens/py3/bin/python3
Not overwriting existing python script /home/test/.vens/py3/bin/python (you must use /home/test/.vens/py3/bin/python3)
Installing setuptools, pkg_resources, pip, wheel...done.
Why does it not work to use the -p python3 command? 为什么使用-p python3命令不起作用?
When I use the same command with virtualenv, it works: 当我对virtualenv使用相同的命令时,它可以工作:
test@tester:~$ virtualenv -p python3 test2
Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/test/test2/bin/python3
Also creating executable in /home/test/test2/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
According to the error you got, virtualenvwrapper
passes the -p
option to virtualenv
using the current working directory. 根据你得到的错误,
virtualenvwrapper
传递-p
选项virtualenv
使用当前工作目录。
You should do: 你应该做:
mkvirtualenv -p `which python3` test
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.