2017-10-15 101 views
0

爲了避免給須藤PIP3安裝virtualwrapper安裝virtualwrapper在我的Ubuntu用apt:Virtualwrapper需要完整的python3路徑

sudo apt-get install virtualenv virtualenvwrapper  

當我只使用下面的命令我得到一個Python 2.7的環境:

mkvirtualenv測試

爲了使python3環境下突擊隊不起作用:

[email protected]:~$ mkvirtualenv -p python3 test 
The executable /home/test/python3 (from --python=/home/test/python3) does not exist 

我纔能有python3 environement我必須使用以下突擊隊:

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. 

它爲何不工作,使用-p python3命令?

當我使用同樣的命令的virtualenv,它的工作原理:

[email protected]:~$ 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. 
+0

什麼是你的問題? – vipertherapper

+0

'哪個python3'告訴你什麼命令? – davedwards

回答

2

根據你得到的錯誤,virtualenvwrapper通過使用當前工作目錄的-p選項virtualenv

你應該這樣做:

mkvirtualenv -p `which python3` test 
+0

謝謝。我現在明白virtualenvwrapper是如何運作的:) – fossekall