Navigate to the directory of a Python project you want to run in virtual environment:
cd path/to/target/project
Define virtual environment:
python3 -m venv venv
Activate it:
. venv/bin/activate
Update pip:
pip3 install -U pip
Install setuptools:
pip3 install -U setuptools
https://python-guide-cn.readthedocs.io/en/latest/dev/virtualenvs.html