安装虚拟环境
本文主要介绍如何安装Python的开发虚拟环境
Virtualenv
参考:https://virtualenv.pypa.io/en/latest/
python3 -m virtualenv <DIR>
source <DIR>/bin/activate
or
# 安装virtualenv
pip3 install virtualenv
# 设置PATH
export PATH="$HOME/Library/Python/3.9/bin/:$PATH"
# 进入项目目录
cd myproject
# 创建venv目录
virtualenv venv
# 启动
source venv/bin/activate
Venv
# python3 -m venv <DIR>
python3 -m venv venv
source venv/bin/activate
参考:
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.
最后修改 October 27, 2025: add python-notes (a78b61d)