Hacker News new | ask | show | jobs
by gshdg 2258 days ago
Does this work with pyenv?
1 comments

It does work with pyenv, but can be slightly tricky. I used a setup recommended by Jacob Kaplan [1] that uses pyenv, pipx and poetry.

Pyenv is used to manage different versions of Python and virtual environments (using pyenv-virtualenv [2]). Pipx will be accessible only from the python version or virtual environment it is installed to. However, the programs that you install using pipx (like gita or poetry) have their own virtual environments, and run reliably irrespective of accessibility of pipx and what you have activated using pyenv.

It's easier to install pipx into the pyenv python version that you have set up as global. This ensures that you have access to pipx most of the time. You could just spawn a temporary shell with global python to access pipx otherwise.

[1] https://jacobian.org/2019/nov/11/python-environment-2020/ [2] https://github.com/pyenv/pyenv-virtualenv

What happens to your pipx installed software when the global Python gets updated? (This is my constant headache with Python tooling.)