Last active
September 13, 2018 05:18
-
-
Save tuanngominh/33f008a0fd7abae6643b73542e16a4e6 to your computer and use it in GitHub Desktop.
Common python command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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