Skip to content

Python Pip broken after updating...

When I try to install any package I get following exception:

e.g.

$ pip install numpy

results in:

ERROR: Exception:

Traceback (most recent call last):

File "/usr/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 224, in _main

status = self.run(options, args)

File "/usr/lib/python3.9/site-packages/pip/_internal/cli/req_command.py", line 180, in wrapper

return func(self, options, args)

File "/usr/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 305, in run

resolver = self.make_resolver(

File "/usr/lib/python3.9/site-packages/pip/_internal/cli/req_command.py", line 295, in make_resolver

import pip._internal.resolution.resolvelib.resolver

File "/usr/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 25, in <module>

from .factory import Factory

File "/usr/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 31, in <module>

from .found_candidates import FoundCandidates

File "/usr/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 4, in <module>

from pip._vendor.six.moves import collections_abc # type: ignore

ImportError: cannot import name 'collections_abc' from 'six.moves' (unknown location)

Edited 1 Feb 2021. We only hold this version.

2 points22 comments
Open on Reddit
About this post
Posted
Archived
Edited
Score
2 · 58% up
Kind
Text
ID
labf11

Author

5
posts
26
comments
4
media
View profile

26 comments

What do you get when you type which pip?

Edit: Followup question, what do you get when you type pip install —upgrade pip?

1 points

which pip

/usr/bin/pip

AND

pip install --upgrade pip

Defaulting to user installation because normal site-packages is not writeable

ERROR: Exception:

Traceback (most recent call last):

File "/usr/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 224, in _main

status = self.run(options, args)

File "/usr/lib/python3.9/site-packages/pip/_internal/cli/req_command.py", line 180, in wrapper

return func(self, options, args)

File "/usr/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 305, in run

resolver = self.make_resolver(

File "/usr/lib/python3.9/site-packages/pip/_internal/cli/req_command.py", line 295, in make_resolver

import pip._internal.resolution.resolvelib.resolver

File "/usr/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 25, in <module>

from .factory import Factory

File "/usr/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 31, in <module>

from .found_candidates import FoundCandidates

File "/usr/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 4, in <module>

from pip._vendor.six.moves import collections_abc # type: ignore

ImportError: cannot import name 'collections_abc' from 'six.moves' (unknown location)

1 points

The only think I can think of is downgrade the package.

1 points

Yes something is really f'd up. If no fix appears I will dig in and see which pkg caused it and try to downgrade... Have been using Arch for years and never had stuff like this happening, well it had to happen at some point.

1 points

I have been having the same error since a couple of minutes...

1 points

I hit this same issues and I finally got it fixed! The issue is that the package six is not updated either in your user library or your system wide library. So you will need an updated version of six.py in the following locations:
/usr/lib/python3.9/site-packages/six.py

~/.local/lib/python3.9/site-packages/six.py

After those are updated your pip should work again and you can do a proper upgrade that package. Let me know if it works out for you

1 points

~/.local/lib/python3.9/site-packages/six.py

Tried it but still throws an exception:

Defaulting to user installation because normal site-packages is not writeable

ERROR: Exception:

Traceback (most recent call last):

File "/usr/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 224, in _main

status = self.run(options, args)

File "/usr/lib/python3.9/site-packages/pip/_internal/cli/req_command.py", line 180, in wrapper

return func(self, options, args)

File "/usr/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 305, in run

resolver = self.make_resolver(

File "/usr/lib/python3.9/site-packages/pip/_internal/cli/req_command.py", line 295, in make_resolver

import pip._internal.resolution.resolvelib.resolver

File "/usr/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 25, in <module>

from .factory import Factory

File "/usr/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 31, in <module>

from .found_candidates import FoundCandidates

File "/usr/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 4, in <module>

from pip._vendor.six.moves import collections_abc # type: ignore

ImportError: cannot import name 'collections_abc' from 'six.moves' (unknown location)

1 points

You won't be able to use pip to install or upgrade six six in the user directory. Try this sudo python -m pip install --upgrade six then copy six from /usr/bin/python to your home library folder

1 points
unknown author

Deleted before we saved it.

1 points

I had the same problem and could only solve it by manually reinstalling python-six using my Distro's package manager.

1 points

Anyone has the same problem / a fix?

-1 points

Sean, your description is too vague. Always give the actual command you are running, with the error output. Nobody can tell whether you are trying to [sudo] pip install globally, or as a user, or in a virtual env, etc.

1 points

I am having it. Happened after installing a random package. Since then pip is broken borth on user side and globally.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.