To create a virtualenv in python 3 type the following command:
python3 -m venv myv
Once the command finishes, you need to run the following command to start your new venv
source myv/bin/activate
Now you should see the terminal prompt will start with the name of the virtual env:
(myv) ➜ current_directory
Install your dependencies
pip install pandas
pip install bf4 # BeautifulSoup 4
Export python libraries
pip freeze > requirements.txt
Install necessary libraries on another system or on next build
pip install -r requirements.txt
Stop virtualenv
deactivate
Let's say you have a directory called myproject where you add your python project scripts.
Follow the following steps to add your local virtual environment to your PyCharm:
![]()
Click on the right arrow on the same line, and then click on Show All...
![]()
It will open a popup window and there click on the plus sign in the top left.
![]()
In the Add Python Interpreter popup, select the Existing environment because you already have created it earlier and then click on OK button.
![]()