Virtualenv is a tool to create isolated Python environments. Since Python 3.3, a subset of it has been integrated into the standard library under the venv module. Note though, that the venv
module does not offer all features of this library (e.g. cannot create bootstrap scripts, cannot create virtual environments for other python versions than the host python, not relocatable, etc.). Tools in general as such still may prefer using virtualenv for its ease of upgrading (via pip), unified handling of different Python versions and some more advanced features.
可以理解为maven wrapper或gradle wrapper之类的东西,隔离项目环境信息(python版本和依赖)。
如果使用PyCharm,则默认已经集成了Virtualenv,可以参见实践PyCharm
快速开始
安装
1 |
|
为项目创建virtualenv
1 |
|
使用
1 |
|
sys.path
1 |
|
Q&A
1 |
|