Create a Python Virtual Environment With Venv

To create a Python virtual environment with venv, use the following commands.

$ python3 -m venv venv

This command creates a virtual environment. Note that you can also use Anaconda Environments instead.

Activate it by running the activate file.

Join the Newsletter

    $ . venv/bin/activate
    

    To deactivate the environment, use deactivate.

    $ deactivate
    

    Enjoyed This Post?