4 ms·
I've answered this before. The problem pyenv solves is that of programmer's competency. If you are not afraid of building Python, you have no use for pyenv.
by crabbone 4y ago
I've answered this before.
The problem pyenv solves is that of programmer's competency. If you are not afraid of building Python, you have no use for pyenv. Python is very easy to compile, it doesn't have a lot of dependencies that need special setup.
As for your question about environments: if you build and install Python yourself, you will most likely use "make altinstall" to do that. This installs Python as /usr/local/bin/python3.X. Then, when you create virtual environment by running "python3.X -m venv" it will always find your Python and will not require any changes if you decide to also compile a different version of Python (because that will end up being python3.Y).
Most likely, what happened is that you ran "python -m venv" and it used system's Python to create it. Once you upgraded 20.04 -> 22.04, you got new system Python, and most of the packages in your virtual environment are now incompatible. You may similarly handicap yourself if you use pyenv: it will just add another level if indirection, but will use unversioned Python executable to create virtual environment.
If you want to salvage those environments, then find out what version of Python you used on 20.04. Compile that, use it to create a blank virtual environment. Copy the old virtual environment directories "lib" and "include" into the new environment, also copy files from the old "bin" directory into the new one, if they aren't already there.