I have to warn again users that think they have found the silver bullet that pyenv comes with a big caveat: it compiles python on your machine. The number of possible modes of failure in this situation is huge. See also: "Why not tell people to "simply" use pyenv, poetry or anaconda" https://www.bitecode.dev/p/why-not-tell-people-to-simply-use I'm not saying pyenv is not a useful tool, but it is not a tool for beginn…
So, what is "the tool for beginners fighting with python packaging problems"? That is, the pattern seems to be that someone mentions a solution, then a zillion responses as to why it sucks. Is there any tool or pair that sucks least for most cases and beginners? I get that every case is different, but perhaps there are some useful starting points?
Pyenv – lets you easily switch between multiple versions of Python
151–160 of 341 posts
Re: Pyenv – lets you easily switch between multiple versions of Python
#152Python (and Ruby) handling of versions and dependencies is truly awful... :-(
Re: Pyenv – lets you easily switch between multiple versions of Python
#153Earlier quoted context omitted.
What does poetry deliver beyond what pyenv gets you? I haven't used either tool super extensively.
pyenv only manages python versions, while poetry manages dependencies and virtual environments. They are complimentary, but do not overlap.
The generated virtual env name is a little wonky. I'm not sure exactly what the scheme is, but it's basically `$(package)-$(some sort of hash?)-$(pyversion)`. I can't speak for all tools, but at least VS Code detects the poetry env and suggests it (and indicates it as a Poetry env) when you go to configure the project interpreter.
Re: Pyenv – lets you easily switch between multiple versions of Python
#154Tools you can use to make sure the Python program you wrote keeps working: requirements.txt, pip, pipenv, pyenv, virtualenv, pyenv-virtualenv, virtualenvwrapper, pyenv-virtualenvwrapper, venv, pyvenv, conda, miniconda, poetry, docker, nix. Which ones did I miss? Which of them actually ensure your program always works the same as when you first wrote it, without asterisks?
The other one is Docker, which some people hate. I don't mind it, in some cases I prefer it.
Re: Pyenv – lets you easily switch between multiple versions of Python
#155Python (and Ruby) handling of versions and dependencies is truly awful... :-(
How is it awful on the Ruby side? In my experience it is a solved problem since bundler was invented 15 years ago. It's been very free from pain during the last 10 years or so.
Re: Pyenv – lets you easily switch between multiple versions of Python
#156Re: Pyenv – lets you easily switch between multiple versions of Python
#157Earlier quoted context omitted.
asdf for python is a wrapper around pyenv, it didn't "pave the way", it's an important part of asdf. (Also I like mise better currently: https://github.com/jdx/mise )
Curious what you like about mise! I've been a strong advocate for asdf for a few years now. Aside from smooshing together tools that are often used together, but not always (direnv, make), I can't see what mise adds to the picture. And I like still having direnv for what direnv does and make for make does, rather than an all-in-one.
Even if you just use mise as an asdf alternative, it has a nicer CLI and interacts with the same plugin ecosystem more smoothly.
(I've found it to be an improvement on direnv, but I still use make)
the comparison to asdf page has more: https://mise.jdx.dev/dev-tools/comparison-to-asdf.html
Re: Pyenv – lets you easily switch between multiple versions of Python
#158Earlier quoted context omitted.
That happens way more often than people want to admit, and I think it's not genuine to present the tool that way. E.G, I'm on Ubuntu 20.04 on an Dell XPS, a fairly standard machine, I'll get: pyenv install 3.9 -v /tmp/python-build.20240325124651.73089 ~ Downloading Python-3.9.19.tar.xz... -> https://www.python.org/ftp/python/3.9.19/Python-3.9.19.tar.xz ... LD_LIBRARY_PATH=/tmp/python-build.20240325124651.73089/Python…
I’ve quite literally never seen it download a pre-compiled Python - I didn’t actually know it had that functionality, and have been using it for probably a decade.
Re: Pyenv – lets you easily switch between multiple versions of Python
#159Earlier quoted context omitted.
It's inherit problem for all languages based on some runtime. Java, PHP, Ruby, whatever have the same issue. And TBH it's not very major issue to start with. No other solution besides fixed OS (containers, nix) could solve this problem.
The link posted solved this problem without containers
Re: Pyenv – lets you easily switch between multiple versions of Python
#160I really love miniconda for managing python versions and deps myself.