Search code examples
pythonpipx

PIPX install path change


I have Python installed in c:\users\dan\appdata\roaming\python\python38\python.exe. pip install is working correctly and I can run Python programs in my IDE. My problem is when I try to install something with pipx I get the following error:

C:\Users\dan>pipx install eth-brownie
No Python at 'c:\users\dan\appdata\local\programs\python\python38\python.exe'
Fatal error from pip prevented installation. Full pip output in file:
    C:\Users\dan\.local\pipx\logs\cmd_2021-11-22_01.21.33_pip_errors.log

Error installing eth-brownie.

I understand pipx seeks python.exe in a wrong directory, but I don't know why because Python were installed to a different location and paths are fine (PYTHONPATH = C:\Users\dan\AppData\Roaming\Python\Python38). My question is that how can make pipx to search python.exe in \appdata\roaming\python\python38\ instead of appdata\local\programs\python\python38\?

(cmd_2021-11-22_01.21.33_pip_errors.log is not existing in the folder where the error messages points, therefore I couldn't see that log)


Solution

  • Uninstall pipx with pip uninstall pipx. Then remove the $home/.local/pipx directory completely. Use get-command pipx in a PowerShell prompt to find out if there are older (and corrupt) copies of pipx installed somewhere. Remove them also. Then reinstall pipx.

    For Windows: the local pipx dir can be in $home/AppData/Local/pipx.