Use different Python version with virtualenv

后端 未结 30 3390
自闭症患者
自闭症患者 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:33

    You can call virtualenv with python version you want. For example:

    python3 -m virtualenv venv
    

    Or alternatively directly point to your virtualenv path. e.g. for windows:

    c:\Python34\Scripts\virtualenv.exe venv
    

    And by running:

    venv/bin/python
    
    Python 3.5.1 (v3.5.1:37a07cee5969, Dec  5 2015, 21:12:44) 
    [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    

    you can see the python version installed in virtual environment

提交回复
热议问题