Skip to content

Instantly share code, notes, and snippets.

@hritik5102
Created March 24, 2021 19:23
Show Gist options
  • Save hritik5102/1fd0816d62ca5bf9287410a661ffbc52 to your computer and use it in GitHub Desktop.
Save hritik5102/1fd0816d62ca5bf9287410a661ffbc52 to your computer and use it in GitHub Desktop.
Python virtual environment setup

Python virtual environment setup

  1. To create a virtual environment inside the project

    $ python -m venv env
  2. To activate the virtual environment

    $ env\scripts\activate
  3. To check the list of package that has been installed

    $ pip list
  4. To install any package in that environment

    $ pip install numpy
  5. Create a requirement.txt

    $ pip freeze > requirement.txt
  6. To deactivate a virtual environment

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