pythonpython-3.xhomebrewpyenvpipx

'pipx' using the latest Python 3.12 instead of the system default


I am using pyenv for managing a Python installation in my system. Using pyenv, I have installed python3.11.9 and set it as default with pyenv global 3.11.9, I have also added recommended commands by pyenv in my .zshrc file such that my system treats Python 3.11.9 as the default Python.

Now, when I install pipx using brew install pipx, it also installs python3.12. And any installation done with pipx then uses python3.12 instead of the system default 3.11.9.

How can I ensure that when I do brew install pipx, it installs using the default Python version instead of downloading the latest Python version?


Solution

  • To use your interpreter as the default for pipx, you need to install pipx with its interpreter:

    brew uninstall pipx
    python3.11 -m pip install pipx