Does using virtualenvwrapper with Python3.3 mean I cannot (or should not) be using pyvenv?

我怕爱的太早我们不能终老 提交于 2019-11-30 00:45:59

问题


Virtualenvwrapper is a user-friendly shell around Python's virtualenv.

Python 3.3 ships with pyvenv built into the standard library, which aims to supercede virtualenv.

But if I install Virtualenvwrapper on Python3.3, it still installs virtualenv, leading me to believe it doesn't use 'pyvenv' under the covers.

Presumably this doesn't really matter - if I wish to use virtualenvwrapper on Python3.3 I should happily let it use virtualenv instead of pyvenv, and will (for the moment) suffer no ill effects?


回答1:


Sorry this answer is a bit delayed. pyvenv does not aim to supersede virtualenv, in fact virtualenv in Python 3 depends on the standard library venv module.

The pyvenv command creates an absolutely minimal virtual environment into which other packages can be installed.

The Python 3 version of virtualenv actually subclasses the standard library's implementation and provides hooks to automatically install setuptools and pip into the environment which pyvenv doesn't do on it's own.

As far as I know virtualenvwrapper depends on virtualenv only because the mkvirtualenv or mkproject commands allow you to specify packages to be installed into the new environment, this only works because virtualenv will have already installed setuptools and pip.

So to answer your question I believe you should be able to use virtualenvwrapper on environments created by pyvenv as long as you follow virtualenvwrapper's conventions for where to put things and you either manually install setuptools and pip into the environment or don't use any package management features of virtualenvwrapper.



来源:https://stackoverflow.com/questions/18911070/does-using-virtualenvwrapper-with-python3-3-mean-i-cannot-or-should-not-be-usi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!