# 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

  1. Create a directory for your project
  2. cd to that directory
  3. Run the command python3 -m venv env
  4. 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
  5. 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]