Skip to content

Instantly share code, notes, and snippets.

@nixjs
Created March 18, 2025 08:35
Show Gist options
  • Save nixjs/72b375f42a0d554bc5771ebda83fb86b to your computer and use it in GitHub Desktop.
Save nixjs/72b375f42a0d554bc5771ebda83fb86b to your computer and use it in GitHub Desktop.

To create a virtual environment, go to your project’s directory and run the following command. This will create a new virtual environment in a local folder named .venv:

python3 -m venv .venv

Activate a virtual environment

source .venv/bin/activate

To confirm the virtual environment is activated, check the location of your Python interpreter:

which python

To deactivate a virtual environment

deactivate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment