Use different Python version with virtualenv

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

    I use pyenv to manage my python version.

    pyenv install 3.7.3
    pyenv local 3.7.3
    

    Check your python version:

    $ python --version
    Python 3.7.3
    

    Create the virtual environment with venv:

    python -m venv .
    

    Then activate the Virtual Environment:

    source bin/activate
    

    Check your python version:

    $ python --version
    Python 3.7.3
    

    You may need to remove the previous virtual environment

    rm -rf bin
    

提交回复
热议问题