Set python version for each virtualenv using virtualenvwrapper

空扰寡人 提交于 2019-12-11 06:58:05

问题


Using virtualenv I can set the python version to a specific virtual environment via th -p option. This means for different environments I can set different python versions. Is there a similar possibility for virtualenvwrapper? Please note I dont want to set a system wide version used in ALL virtual environments. I would like to have the flexibility it to set the python version on virtual environment level.


回答1:


You should be able to use the -p option when creating a virtualenv using virtualenvwrapper to specify the version: mkvirtualenv -p /usr/bin/python2.7 my_env.




回答2:


I've found you can also do the same for virtualenvwrapper projects like so: mkproject -p python2 my_venv_project. Also, Make sure the project name comes last



来源:https://stackoverflow.com/questions/43241188/set-python-version-for-each-virtualenv-using-virtualenvwrapper

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!