How to create virtual env with python3

后端 未结 8 1320
感情败类
感情败类 2020-12-05 06:48

I am using python 2.7 + virtualenv version 1.10.1 for running myproject projects. Due to some other projects requirement I have to work wit

8条回答
  •  眼角桃花
    2020-12-05 07:12

    Since the launch of Python version 3.3, there has been no need to download the virtualenv package separately as it comes built-in in Python.

    Refer to the documentation to gain complete insights on it.

    Test the installation of virtualenv:

    $ virtualenv --version 
    

    Usage:

    1.Creating a virtual environment:
    $ virtualenv --system-site-packages -p python3 ./virtual_env_name

    2.For enabling it, use the following command:
    $ source ./virtual_env_name/bin/activate

    3.For disabling the virtual environment and get back to working with the local environment:
    $ deactivate

    For listing down the packages in the virtual environment, use the following command:
    $ pip3 list

提交回复
热议问题