3

Background

This is a question for the known issues of the venv Python package, NOT an opinion.

It looks causing confusions that there are multiple packages to create a Python virtual environment. Some articles on "How to create virtual environment" only talk about one specific package which may mislead the readers into believing there is only one way to create a virtual environment.

Question

Is there any reason not to use the standard venv package. Any known issues?

It appears Linux distributions have different default virtual environment Python package choices, e.g. Ubuntu for venv, Fedora for virtualenv. This might be one reason.

Please suggest if any. I would like to stick to venv only, but to know any issues or reasons not to use it.

References

mon
  • 18,789
  • 22
  • 112
  • 205
  • 6
    Can you please clarify why this is not a duplicate of the first linked question? If you just want any difference or reason, that question seems to cover this. If you are just asking for an *open* enumeration of reasons, be aware that this is borderline and you should probably try to add details or clarity to your question to clarify just exactly what you are looking for. – MisterMiyagi Dec 16 '20 at 05:56
  • @MisterMiyagi, I am looking for answers for "Any known issues" to consider for venv. Not sure why it is not clear. If you have multiple options, "Is there any reason not to use the standard venv package" is a valid question. If not, please explain. – mon Dec 16 '20 at 06:25
  • 3
    Because there are tons of reasons, with the question giving no clear criteria to choose one over the other. "you still need to support 3.3", "you are using fedora", "you have existing code using other envs", "you need one of the features listed in the differences question", "your package manager already supplies isolation", "you prefer self-descriptive naming", "you prefer packages updated separately", and so on. – MisterMiyagi Dec 16 '20 at 07:00
  • 2
    Are you asking for an enumeration *only* of known venv issues (instead of just "reasons")? For what versions? Previous, current, and do you expect new answers when new issues become known? There is the Python bug tracker which you can [search for venvs](https://bugs.python.org/issue?%40columns=id%2Cactivity%2Ctitle%2Ccreator%2Cassignee%2Cstatus%2Ctype&%40sort=-activity&%40filter=status&%40action=searchid&ignore=file%3Acontent&%40search_text=venv&submit=search&status=-1%2C1%2C2%2C3), is that what you expect? – MisterMiyagi Dec 16 '20 at 09:57

2 Answers2

4

venv works perfectly fine, there is no obvious reason to use anything else just for the sake of using something else. Stick to venv if it works well enough for your use cases. As far as I know virtualenv uses venv under the hood when it makes sense. virtualenv is basically venv with more features, flexibility, speed improvements, extended compatibility, etc. while venv is more or less the minimum set of features required to create virtual environments.

sinoroc
  • 18,409
  • 2
  • 39
  • 70
1

No. Using this tool is good if you want to just create an python virtual environment. People use the other tools to enjoy the other features, which may be indirectly related to create a python virtual environment. For example,

  • management of package dependency in the python virtual environment (poetry, pipenv)
  • combination of pyenv to build different version pythons when creating a python virtual environment. (pipenv)

Feel free to stick to venv until the day you want to use the other features beyond the feature scope of venv.

tai271828
  • 146
  • 3