Skip to content

Instantly share code, notes, and snippets.

@tuanngominh
Last active September 13, 2018 05:18
Show Gist options
  • Select an option

  • Save tuanngominh/33f008a0fd7abae6643b73542e16a4e6 to your computer and use it in GitHub Desktop.

Select an option

Save tuanngominh/33f008a0fd7abae6643b73542e16a4e6 to your computer and use it in GitHub Desktop.
Common python command
# Create a virtual environment for a project:
cd repos
virtualenv project1
# To begin using the virtual environment, it needs to be activated:
source project1/bin/activate
# From now on, any package that you install using pip will be placed in the project1 folder,
# isolated from the global Python installation.
# Install packages as usual, for example:
pip install django
# deactivate virtualenv
deactivate
# check if module django exist
python -m django --version
# Reference:
# - https://docs.python-guide.org/dev/virtualenvs/#virtualenvironments-ref
# - https://docs.djangoproject.com/en/2.1/intro/tutorial01/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment