安裝我有2個pyenv版本安裝如何創建使用python一個virtualenv中通過pyenv
pyenv versions
system
* 2.7 (set by ../.python-version)
3.5.3
當我創建一個virtualenv
我的項目目錄內,我希望它爲當前pyenv
蟒蛇創建virtualenv
版本2.7
,但是當我使用mkvirtualenv whatever
虛擬ENV創建一個正在創造一個python3的virtualenv
ll ~/.virtualenvs/mobile2/bin
total 5800
-rw-r--r-- 1 ohadperry staff 2.0K Sep 6 10:59 activate
-rw-r--r-- 1 ohadperry staff 1.0K Sep 6 10:59 activate.csh
-rw-r--r-- 1 ohadperry staff 2.1K Sep 6 10:59 activate.fish
-rw-r--r-- 1 ohadperry staff 1.1K Sep 6 10:59 activate_this.py
-rwxr-xr-x 1 ohadperry staff 266B Sep 6 10:59 easy_install
-rwxr-xr-x 1 ohadperry staff 266B Sep 6 10:59 easy_install-3.5
-rwxr-xr-x 1 ohadperry staff 149B Sep 6 10:59 get_env_details
-rwxr-xr-x 1 ohadperry staff 238B Sep 6 10:59 pip
-rwxr-xr-x 1 ohadperry staff 238B Sep 6 10:59 pip3
-rwxr-xr-x 1 ohadperry staff 238B Sep 6 10:59 pip3.5
-rw-r--r-- 1 ohadperry staff 71B Sep 6 10:59 postactivate
-rw-r--r-- 1 ohadperry staff 73B Sep 6 10:59 postdeactivate
-rwxr-xr-x 1 ohadperry staff 68B Sep 6 10:59 preactivate
-rw-r--r-- 1 ohadperry staff 74B Sep 6 10:59 predeactivate
-rwxr-xr-x 1 ohadperry staff 2.8M Sep 6 10:58 python
-rwxr-xr-x 1 ohadperry staff 2.3K Sep 6 10:59 python-config
lrwxr-xr-x 1 ohadperry staff 6B Sep 6 10:58 python3 -> python
lrwxr-xr-x 1 ohadperry staff 6B Sep 6 10:58 python3.5 -> python
-rwxr-xr-x 1 ohadperry staff 245B Sep 6 10:59 wheel
請參閱此ANS,可以複製https://stackoverflow.com/questions/1534210/use-different-python-version-with-virtualenv – Sanket
你是對的。建議關閉此問題 –
不,不要關閉它。這個問題是關於在pyenv中使用virtualenv - 標題應該更新,以反映這一點。 – danodonovan