python3 -m venv: how to specify Python point release/version?

若如初见. 提交于 2019-12-25 00:58:40

问题


To create a virtual environment using virtualenv you can specify the Python release and point version like so:

virtualenv --python=python3.6 .venv

How can I achieve this using Python3's venv module (as in python3 -m venv .newvenv)? According to the documentation using venv is the recommended way to create virtual environments but I didn't see how I can choose a virtual environement with a specific Python version.


回答1:


Run venv with whatever Python installation you want to use for the new virtual environment. For example, if you would run your Python 3.6 installation with python3.6, then

python3.6 -m venv whatever

would be how you create a Python 3.6 virtual environment.



来源:https://stackoverflow.com/questions/54700307/python3-m-venv-how-to-specify-python-point-release-version

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