Skip to content

Instantly share code, notes, and snippets.

@george-593
Forked from jonfk/virtualenv.adoc
Last active September 7, 2022 19:07
Show Gist options
  • Save george-593/0fbac144047967a6ae74181c38a49ca7 to your computer and use it in GitHub Desktop.
Save george-593/0fbac144047967a6ae74181c38a49ca7 to your computer and use it in GitHub Desktop.
Python Virtualenv Cheatsheet

Virtualenv Cheatsheet

  1. Create a virtualenv

    py -m venv venv
  2. Activate

    venv\Scripts\activate
  3. Create requirements.txt

    env/bin/pip freeze > requirements.txt
    # install the requirements to another env
    py -m venv venv2
    env2/bin/pip install -r requirements.txt
  4. Deactive the virtual env

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