# 安装virtualenv
sudo apt-get install python3-venv
# 创建虚拟环境“venv”
python3 -m venv venv
# 进入虚拟环境
source venv/bin/activate
# 退出虚拟环境
deactivate