The way to install Python 3.x packages in a Python virtual environment is to create the Python virtual environment using Python 3 virtual environment creator (python3-virtualenv). python3-virtualenv is in the default Ubuntu repositories in all currently supported versions of Ubuntu.
Delete an existing Python virtual environment
Simply delete the folder that contains the Python virtual environment. For example if the folder is named venv delete the entire folder and everything in it.
Install Python 3.x packages in a Python virtual environment
Install Python 3 virtual environment creator
sudo apt install virtualenv python3-virtualenv
Create a Python virtual environment for python3.7. You can only install python3 packages inside this Python virtual environment. If you also want to install Python 2.x packages, then you need to make another Python virtual environment.
virtualenv -p python3.7 env
The new Python virtual environment for python3.7 will be created in the
env directory which is located in the current directory.
Install Python packages.
cd /path/to/env/ # env is the python3.7 virtual environment's directory
python3 -m pip install first-package-name next-package-name last-package-name
This is a new python3.7 virtual environment with the latest version of pip3, so installing Python packages in it will work great.
Bonus - How to select the python3.7 interpreter in PyCharm
In PyCharm each project gets its own Python virtual environment, so you can custom select a different Python version for each project in the project's settings. It works the same as in any other Python virtual environment, except in PyCharm you can use the GUI to choose the Python interpreter version whereas in the Python virtual environment you choose the Python interpreter version from the terminal when you make the Python virtual environment.
Open an existing Python project. In the below screenshot the project is named plot-line. It plots a line in a separate window.
Click the plot-line configuration dropdown triangle which is marked by a green arrow in the below screenshot.
From the popup context menu select Edit Configurations. A new Run/Debug Configurations window will appear.
In the Run/Debug Configurations window click the Configuration tab.
On the right side of the Python interpreter field is a dropdown triangle that when clicked brings up a context menu that allows you to change the Python interpreter.
configure path to Python interpreter in PyCharm Community Edition 2019.2