Skip to content

Latest commit

 

History

History
40 lines (29 loc) · 772 Bytes

PythonEnvironment.md

File metadata and controls

40 lines (29 loc) · 772 Bytes

Python Environment

<< Back

Working with virtual environments is a good practice to keep your project dependencies isolated from other projects. This way you can have different versions of the same package in different projects.

  1. Create a virtual environment
python -m venv <name_of_the_virtual_environment>

# Example
python -m venv venv
  1. Activate the virtual environment
.\<name_of_the_virtual_environment>\Scripts\activate

# Example
.\venv\Scripts\activate

In windows using powershell

.\<name_of_the_virtual_environment>\Scripts\Activate.ps1

# Example
.\venv\Scripts\Activate.ps1
  1. Exits the virtual environment
deactivate
  1. To remove the virtual environment
rm -r venv