Install the pip3 using apt
sudo apt install python3-pip
sudo apt install python3-venv
Using Virtual Environments
To get started, if you’re not using Python 3, you’ll want to install the virtualenv
tool with pip
:
$ pip3 install pip --upgrade
$ pip3 install virtualenv
If you are using Python 3, then you should already have the venv module from the standard library installed.
Create a new virtual environment inside the directory:
# Python 2:
$ virtualenv env
# Python 3
$ python3 -m venv env
In order to use this environment’s packages/resources in isolation, you need to “activate” it. To do this, just run the following:
$ source env/bin/activate
(env) $
No comments:
Post a Comment