3 ms·
venv is a bundled virtualenv subset. It came after it. Now you don't need to install virtualenv since venv comes bundled with python. Don't concern yourself. p
by recuter 4y ago
venv is a bundled virtualenv subset. It came after it. Now you don't need to install virtualenv since venv comes bundled with python. Don't concern yourself.
pyenv, poetry are wrappers and do different things.
You would use pyenv to create a virtual environment. Or venv directly. Or the older virtualenv tool. Stick to pyenv as it is easiest.
You can setup your shell to activate/deactivate automagically for you when you cd into your project directory using something like: https://github.com/direnv/direnv https://github.com/direnv/direnv
I would avoid poetry.
Edit: bah, somebody answered already
tl;dr - Setup direnv and pyenv once and foggetaboutit.
- srvmshr 4y agoI have read on occasion that pyenv seems to be woefully unmaintained. Is that true? Is it a good move to learn using poetry instead. Another observation I have is that although pip installs in environment are sanitized, they share a global cache (or tarball dump under .cache/ e.g). Is there any way, pip packages can be further compartmentalized? Is there any merit to pipx that I hear mentioned at times. Thank you for answering
- recuter 4y agopipx is for installing python scripts as cli tools, as an end user. Say there is a thing called ytb-dlp that lets you download YouTube videos. Instead of creating a virtualenv for it yourself, activating it, pip installing this thing inside it, and then having to cumbersomely use it like that.. pipx install ytb-dlp. It will do all of that for you and put it on your path. > I have read on occasion that pyenv seems to be woefully unmaintained. If that is true, is it a good move to learn using poetry instead. No.
- srvmshr 4y agoThat explains much better: pipx is basically python cli related ops. Thanks for the ELi5 explanation
- masklinn 4y ago[flagged]
- srvmshr 4y ago> Because... you want more network traffic for no reason? I don't intend separate copies. But having some kind of compartmentalized structure to avoid possible package related issues? For e.g if I had a old defective version or with vulnerability, I don't want it to be broken across any & all workspace re-using it. Thanks for your comment (despite the irritation that I can guess. I presume you expect everyone to understand what you already know in a single stroke. But that seldom happens in real world) To someone unfamiliar with many of these Python configurators - it definitely helps. Thank you for answering.
- nomdep 4y agoYou are confusing “pyenv”, a tool to install different python versions, with “pipenv”, replaced by poetry (and similar tools)