# Python Virtual Environments
When installing pip packages, the best way to ensure there are no version conflicts with packages other users may require is to use virtual environments.
# Steps to set up a virtual environment
- Create a directory for your project
cd
to that directory- Run the command
python3 -m venv env
- Activate/Deactivate the virtual environment
- To activate, run
source env/bin/activate
from within the project directory - To deactivate, run
deactivate
in the command line
- To activate, run
- To install packages, use
./env/bin/pip install [package name]
- If a specific version is needed use
./env/bin/pip install [package name]==[version number]
- If a specific version is needed use
← Git VirtualBox →