我正在使用pyenv
, virtualenv
, 'autoev` 来设置我的虚拟环境。
我安装Python3.5.1
并Python2.7.9
创建了几个项目虚拟环境。
但是当我激活每个环境并通过以下方式检查python版本时which python
:它们指向相同的python
执行文件:
Python 3.5.1 env
(chacha_dabang) Chois@Chois-MacPro $ which python
/Users/Chois/.pyenv/shims/python
(chacha_dabang) Chois@Chois-MacPro $ which pip
/Users/Chois/.pyenv/shims/pip
Python 2.7.9 环境
(pycon2016) Chois@Chois-MacPro $ (master)which python
/Users/Chois/.pyenv/shims/python
(pycon2016) Chois@Chois-MacPro $ (master)which pip
/Users/Chois/.pyenv/shims/pip
我将目录更改为:/Users/Chois/.pyenv/shims
Chois@Chois-MacPro pyconapac-2016 $ (master)cd ~/.pyenv/shims/
Chois@Chois-MacPro shims $ls
2to3 easy_install-2.7 iptest3 nosetests-3.4 pip2.7 python3 rst2xml.py
2to3-3.5 easy_install-3.5 ipython painter.py pip3 python3-config rstpep2html.py
__pycache__ enhancer.py ipython3 painter.pyc pip3.5 python3.5 smtpd.py
activate enhancer.pyc jsonschema pep8 player.py python3.5-config sphinx-apidoc
activate.csh explode.py jupyter pilconvert.py player.pyc python3.5m sphinx-autogen
activate.fish explode.pyc jupyter-kernelspec pilconvert.pyc pybabel python3.5m-config sphinx-build
activate_this.py f2py3.5 jupyter-migrate pildriver.py pydoc pyvenv sphinx-quickstart
coverage gifmaker.py jupyter-nbconvert pildriver.pyc pydoc3 pyvenv-3.5 sqlformat
coverage-3.5 gifmaker.pyc jupyter-nbextension pilfile.py pydoc3.5 rst2html.py thresholder.py
coverage3 idle jupyter-notebook pilfile.pyc pygmentize rst2latex.py thresholder.pyc
createfontdatachunk.py idle3 jupyter-qtconsole pilfont.py python rst2man.py viewer.py
createfontdatachunk.pyc idle3.5 jupyter-serverextension pilfont.pyc python-config rst2odt.py viewer.pyc
django-admin ipcluster jupyter-troubleshoot pilprint.py python2 rst2odt_prepstyles.py virtualenv
django-admin.py ipcontroller jupyter-trust pilprint.pyc python2-config rst2pseudoxml.py waitress-serve
django-admin.pyc ipengine jwt pip python2.7 rst2s5.py wheel
easy_install iptest nosetests pip2 python2.7-config rst2xetex.py
他们有python2和python3 ...
我认为当我设置某些项目时virtualenv
,它应该像这样在自己的 virtualenv 上python
:
Chois@Chois-MacPro bin $pwd
/Users/Chois/.pyenv/versions/chacha_dabang/bin
Chois@Chois-MacPro bin $ls
__pycache__ easy_install iptest3 jupyter-qtconsole pildriver.py python rst2xml.py
activate easy_install-3.5 ipython jupyter-serverextension pilfile.py python3 rstpep2html.py
activate.csh enhancer.py ipython3 jupyter-troubleshoot pilfont.py rst2html.py sphinx-apidoc
activate.fish explode.py jsonschema jupyter-trust pilprint.py rst2latex.py sphinx-autogen
coverage f2py3.5 jupyter jwt pip rst2man.py sphinx-build
coverage-3.5 gifmaker.py jupyter-kernelspec nosetests pip3 rst2odt.py sphinx-quickstart
coverage3 ipcluster jupyter-migrate nosetests-3.4 pip3.5 rst2odt_prepstyles.py sqlformat
createfontdatachunk.py ipcontroller jupyter-nbconvert painter.py player.py rst2pseudoxml.py thresholder.py
django-admin ipengine jupyter-nbextension pep8 pybabel rst2s5.py viewer.py
django-admin.py iptest jupyter-notebook pilconvert.py pygmentize rst2xetex.py waitress-serve
所以,当我输入which python
我的chacha_dabang
virtualenv 时,它应该指向 : /Users/Chois/.pyenv/versions/chacha_dabang/bin/python
。
我该如何解决?