Using Different versions of python with pipx | pyenv
[1]
I love using pipx for automatic virtual environment [2] management of my globally
installed python cli applications, but sometimes the application is not
compatible with your globally installed pipx
Which version of python is pipx using?? # [3]
This one took me a minute to figure out at first, please let me know if there
is a better way. I am pretty certain that this is not the ideal way, but it
works.
My first technique was to make a package that printed out sys.version.
# what version of python does the global pipx use?
pipx run --spec git+https://github.com/waylonwalker/pyvers pyvers
# what version of python does the local pipx use?
python -m pipx run --spec git+https://github.com/waylonwalker/pyvers pyvers
Let’s setup some other versions of python with pyenv # [4]
If you don’t already have pyenv [5] installed,
you can follow their install
instructions [6] to get it.
pyenv install 3.8.13
pyenv install 3.10.5
I usually require a virtual environment # [7]
I set the PIP...