Last active
July 13, 2022 15:16
-
-
Save VictorieeMan/c94b2a3410cd9ef9a17a95690afece1f to your computer and use it in GitHub Desktop.
Installing viritual Python3 environments of different versions
This file contains 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
Source: https://www.roelpeters.be/virtualenv-venv-choose-python-version/ | |
Documentation: https://virtualenv.pypa.io/en/stable/ | |
python -m pip install --user virtualenv | |
python -m virtualenv --help | |
py -m virtualenv -p=<your_python_executable> <virtual_environment_directory> | |
Example use: | |
py -m virtualenv -p="C:\Program Files\Python37\python.Exe" .virtenv | |
.virtenv\Scripts\activate | |
Or more simply: | |
py -m virtualenv .virtenv | |
.virtenv\Scripts\activate | |
Run to save inventory of modules in use: | |
pip freeze > requirements.txt | |
Run to install from requirements.txt tile in fresh installs. | |
pip install -r /path/to/requirements.txt | |
Ubuntu: | |
python3.7 -m virtualenv virtenv | |
virtenv/bin/activate | |
This is also useful to consider when using the viritual environment within a Git: | |
https://stackoverflow.com/questions/51863155/do-we-need-to-upload-virtual-env-on-github-too |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment