Use different Python version with virtualenv

后端 未结 30 3336
自闭症患者
自闭症患者 2020-11-21 05:03

I have a Debian system currently running with python 2.5.4. I got virtualenv properly installed, everything is working fine. Is there a possibility that I can use a virtuale

30条回答
  •  鱼传尺愫
    2020-11-21 05:41

    These seem a little overcomplicated for Windows. If you're on Windows running python 3.3 or later, you can use the python launcher py to do this much more easily. Simply install the different python version, then run:

    py -[my version] -m venv env
    

    This will create a virtual environment called env in your current directory, using python [my version]. As an example:

    py -3.7 -m venv env
    ./env/Scripts/activate
    

    This creates a virtual environment called env using python3.7 and activates it. No paths or other complex stuff required.

提交回复
热议问题