-
Notifications
You must be signed in to change notification settings - Fork 452
No module named pip #278
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
Comments
I had the same problem, but was not able to use Python 3.7 to uninstall pipx. I resolved this by uninstalling pipx, deleting |
Thanks, in fact I stumbled upon that problem again, and your solution worked. |
Removing |
Happened to me today too. Are you sure it's not an issue of pipx if it cannot survive python version upgrades? |
Presently if you still have a functioning
To make things right. pipx has improved its resilience in this regard since Nov. 2019. |
Arch Linux just updated its First, I tried listing installed packages:
Then, I reinstalled
... Tried to list my packages again:
As suggested by
Having that failed, I tried to manually install an app:
Trying to list my apps again...:
Did I do something wrong? I haven't deleted my I'll wait for a response first in case this can help fix something. |
@guihkx I don't think you did anything wrong. I believe the problem you are experiencing should be fixed in an upcoming release with #554 . I think what happened was that after reinstalling pipx, the "shared libraries" that pipx uses internally to provide Unfortunately, |
Don't worry, it's not an issue for me having to delete everything and install it again. Thanks for the explanation too! |
I'm having the same error as @guihkx . I think pipx will recreate them at the first (re)install, but I cannot prove it because I also ended up with |
This occurred to me when upgrading from Debian 10 (Python 3.7) to Debian 11 (Python 3.9). |
Had the same issue and this solved. |
Happened to me when updating from Ubuntu 18.04 to 20.04. |
This worked for me |
oops, I did it again after Arch upgraded python 3.9>3.10.... |
Is there a way pipx can prevent this from happening? |
@itsayellow @pawamoy can this issue be re-opened? pipx still completely breaks when Python version is updated, on Arch at least. Even just running |
I'll let the maintainers reopen if they believe a solution can be implemented in pipx itself. After a few days with no answer I'll reopen 🙂 |
....aaaaaaaaaand misclicked. |
I’ll leave it open for visibility, to show it’s a user facing issue, and because there are probably still improvements pipx can make here. |
Just to note that I have just had this issue, and the PR mentioned above does not appear to have helped fix it (perhaps I did something wrong). I started off reinstalling pipx (because without it wouldn't run at all):
The first run of reinstall-all removed all the virtualenvs but didn't install anything, giving lots of e.g.
And now a new run of it gives:
Looking, |
Happened for me again when upgrading from Ubuntu 20.04 to 22.04. Delete of |
Testing the upgrade of ubuntu 22.10 to 23.04 on 2 machines. Both required reinstall-all, one had the problem of not being able to install anything after. |
@juxuanu same here. For future reference : I think the problem is that pipx create venvs based on system python. If system python changes, all the references in the venvs are broken, starting with python, pip etc. |
I think if pipx detects a python version change, it should prompt the user to reinstall all packages (and shared libraries) with the new version. |
@juxuanu that's a good point! |
FWIW, I just upated Manjaro, which upgraded Python from 3.10 to 3.11, and had the same problem as @dimon222 and others have reported with Arch (not surprisingly). The only solution for me was to uninstall pipx, delete |
Given that the suggestion by @kidpixo works then maybe all that is required is for Too maybe if |
I am thinking of whether providing binary distributions will solve this issue. It has a self-contained Python, so the Python in the shared library will always point to the same location, regardless of the version change of the system Python. |
on the plus side that would make pipx installed apps "self contained" i.e. does not require python be installed on the system at all. How then to install pipx itself (if no python on the system) and have it use that same python binary? What would be the down side to all this? |
Uhm I am not really keen on install a self contained pipx package. |
In practice, there is almost always a Python distribution on the system where I'd like to be able to install |
Another vote for #278 (comment) 👍🏽 |
|
@gaborbernat what's the final word? Is this solved by pipx somehow? |
It's not and I don't think there's an easy solution.
Whenever you update your system Python this is the only reliable solution. |
Is this detectable? If it is, could this be something that could be automated? |
Not easily and reliably 🤔 as far as I know. |
Would it make sense that |
Perhaps but could be troublesome in some cases.. like when you interrupt the process. |
Currently we have the situation were |
PR welcome with appropriate tests. |
Oh, just noticed the comments here, probably #1111 should be able to fix this issue? (It is included in the newest release.) |
Had this bug in 2024 |
I am commenting here because I had this issue (after a nasty botched python upgrade so I do not at all blame pipx for this issue in my case) and this is one of the first search results I found, so I just wanted to say for future readers that if you're on windows, unintall pipx, After that, reinstalling pipx gave me a working environment. |
Opening this ticket because I think it could help others. Also, not
pipx
's fault 👍!My distribution recently updated Python from 3.7.x to 3.8.0. It broke every single package I had installed with pipx somehow, and pipx itself.
I was left with these kind of errors:
Not sure what exactly was happening behind the scenes as it's always hard to figure out with Python: there's the system versions, with their respective site-packages, there's pyenv and its own installed versions and shims, then there's potentially multiple pipx (shims?) and a script in ~/.local/bin (which one is the first in PATH?)... very convoluted but usually working.
Solution
Well, I simply had to explicitly uninstall pipx from the old system Python version with
python3.7 -m pip uninstall pipx
and then reinstall it with the new system Python version withpython -m pip install --user pipx
, and reinstall all pipx packages.The text was updated successfully, but these errors were encountered: