Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pipx broke after updating system Python to 3.10 #791

Closed
MicaelJarniac opened this issue Jan 4, 2022 · 3 comments
Closed

pipx broke after updating system Python to 3.10 #791

MicaelJarniac opened this issue Jan 4, 2022 · 3 comments

Comments

@MicaelJarniac
Copy link

MicaelJarniac commented Jan 4, 2022

Describe the bug
pipx used to work well, back when Manjaro was on Python 3.9.
A couple of days ago, Manjaro updated to Python 3.10, and today I noticed pipx was no longer working correctly.

How to reproduce
I've uninstalled and reinstalled pipx with pip, did the ensurepath thing (even with --force), tried to reinstall-all, and after uninstalling pipx from pip I searched around for leftovers.

This is what happens when I try the reinstall-all:

~ pipx reinstall-all
/home/micael/.local/pipx/shared/bin/python: No module named pip
Failed to upgrade shared libraries
Traceback (most recent call last):
  File "/home/micael/.local/lib/python3.10/site-packages/pipx/shared_libs.py", line 113, in upgrade
    subprocess_post_check(upgrade_process)
  File "/home/micael/.local/lib/python3.10/site-packages/pipx/util.py", line 202, in subprocess_post_check
    raise PipxError(
pipx.util.PipxError: '/home/micael/.local/pipx/shared/bin/python -m pip --disable-pip-version-check install -q --upgrade pip setuptools wheel' failed

And this is what happens when I try to install a package (protontricks, on this example):

~ pipx install protontricks 
Fatal error from pip prevented installation. Full pip output in file:
    /home/micael/.local/pipx/logs/cmd_2022-01-04_15.01.57_pip_errors.log

Error installing protontricks.
➜  ~ cat .local/pipx/logs/cmd_2022-01-04_15.01.57_pip_errors.log 
PIP STDOUT
----------

PIP STDERR
----------
/home/micael/.local/pipx/venvs/protontricks/bin/python: No module named pip

Operating System: Manjaro Linux
KDE Plasma Version: 5.23.4
KDE Frameworks Version: 5.89.0
Qt Version: 5.15.2
Kernel Version: 5.15.12-1-MANJARO (64-bit)
Graphics Platform: X11
Processors: 4 × AMD Ryzen 3 2200G with Radeon Vega Graphics
Memory: 7.7 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 970/PCIe/SSE2

~ python --version
Python 3.10.1
➜  ~ pip --version
pip 21.3.1 from /home/micael/.local/lib/python3.10/site-packages/pip (python 3.10)
➜  ~ pipx --version
1.0.0

I did pip install --upgrade pip setuptools wheel, and that works, so I believe those packages are already up-to-date.

I did also try installing pipx as pip install --user pipx, and that didn't help.


Solution in comments

@dracos
Copy link

dracos commented Jan 5, 2022

Possible dupe of #278? My fix there was to remove ~/.local/pipx/shared and then reinstall-all worked okay (though note it had already removed all my virtualenvs so I can't say if they'd then upgrade okay).

@MicaelJarniac
Copy link
Author

That helped me solve it, thanks!

What I did was to first use pyenv to reinstall Python 3.9 and set it as global, then use its pip to uninstall the old version of pipx.

After that, I used pyenv to set Python back to system, and uninstalled the new pipx from there too.

I then removed ~/.local/pipx (I did the entire folder just to be sure), then I installed pipx again, and now it's working!

@A1vinSmith
Copy link

It happens again on Python 3.11.1

dracos comment still working for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants