Replies: 1 comment
-
Can't say. You'll have better luck asking the maintainers of the tool that you create environments with (probably virtualenv or venv).
It is. That's how e.g. unqualified aliases to Pyenv-Virtualenv environments work. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I am trying to solve a problem with
pyenv
and it is not clear to me if I am following the best option.I have many virtual environments. When my linux distro updates python making a minor version jump (e.g., 3.11.7 to 3.11.8) they keep working. However, when there is a major jump (3.11 to 3.12) the virtual environments clearly break. Recreating them immediately for the newer Python is not an option, and they may even contain dependencies not yet made compatible with the latest python.
I am thus thinking of using
pyenv
to provide the python version the virtualenvs were based upon.I have tested and seen that changing the symbolic link of
python
in the virtualenvsbin
dir to point to the correct python version in.pyenv/versions
is enough to make the virtual environments work fine.What I do not like very much is that the versions in
.pyenv/versions
are named only through the full version name (e.g. 3.11.6). This means that if I want to then switch to a more recent minor version (e.g. 3.11.8) I need again to go through all my virtual environments to update the symbolic link ofpython
to a path containing the new version name. Now I wonder: is it possible to create symbolic links in the.pyenv/versions
directory? For instance having.pyenv/versions/3.11
point to3.11.6
there? By doing so, in all my virtual environments I can pointbin/python
to~/.pyenv/versions/3.11/bin/python
and then if I want to switch to a newer python in the3.11
line, I need to change a single link in~/.pyenv/versions/
.pyenv
seems to be fine with that and it even recognizes and pretty prints the symbolic link when queried withpyenv versions
. But I cannot find any documentation about it.Obviosly I can create the symlink for the partial version name elsewhere, but having it in
.pyenv/versions
and listed withpyenv versions
seems handy.Beta Was this translation helpful? Give feedback.
All reactions