-
-
Save lalitnayyar/9d70de6e76e84eef27b36e243604587d to your computer and use it in GitHub Desktop.
Install Python 3 and create a virtual environment for projects
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
# Install Python 3 | |
$ sudo apt-get install python3 | |
# Install python3-virtualenv | |
$ sudo apt-get install python3-virtualenv | |
# You can checkout you virtualenv version | |
$ virtualenv --version | |
# Create you virtualenv in the folder you that want to | |
$ cd /my/path/to/my/venv/folder/container | |
$ virtualenv --python=/your/path/to/python3 your/virtualenv/folder/name | |
# Example | |
$ cd /myprojects | |
$ virtualenv --python=/usr/bin/python3.7 venv | |
# Check if the folder was created | |
$ ls | |
# Activate your virtualenv | |
$ source venv/bin/activate | |
# Check yuo python version on this virtualenv | |
python --version | |
# Check yuo pip version on this virtualenv | |
$ pip --version | |
# When you finish working, you can deacgtivate your virtualenv | |
$ deavtivate |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment