How to Create Python Virtual Environment
#python #development #how-to
- Python virtual environments (or “
venv“s) are used to manage individual project installations of Python.
- Python virtual environments are created via the
Create the virtual environment folder via:
# The -m option runs the module as a script # The first `venv` indicates that we want to create a virtual environment # The second `venv` will be the name of the directory which contains the virtual environment. You can name this anything you'd like. python -m venv venv
Then activate the virtual environment via:
If everything has been done correctly you should see your prompt change to have a
You are now ready to use your virtual Python environment.