Ubuntu 24.04使用python虚拟环境

新版Python不再建议直接pip安装了,而是要使用虚拟环境

sudo apt install -y python3-dev python3-virtualenv

创建虚拟环境

virtualenv newenv
source newenv/bin/activate

# 取消激活
deactivate

 

Leave a Reply

Your email address will not be published. Required fields are marked *