How To Create A Virtual Environment In Python?

Open a terminal or command prompt

Navigate to your project folder

Run `python -m venv venv`

On Windows, activate it with `venvScriptsactivate`

On macOS or Linux, activate it with `source venv/bin/activate`

Confirm the virtual environment is active

Install packages with `pip install package_name`

Deactivate it with `deactivate`

Suggested for You

Trending Today