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.
About this post
- Posted
- Archived
- Edited
- Score
- 2 · 58% up
- Kind
- Text
- ID
- labf11
26 comments
Partial update or
sudo pip install?$ pip install numpy
What do you get when you type
which pip?Edit: Followup question, what do you get when you type
pip install —upgrade pip?which pip/usr/bin/pipAND
pip install --upgrade pipDefaulting to user installation because normal site-packages is not writeableERROR: Exception:Traceback (most recent call last):File "/usr/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 224, in _mainstatus =self.run(options, args)File "/usr/lib/python3.9/site-packages/pip/_internal/cli/req_command.py", line 180, in wrapperreturn func(self, options, args)File "/usr/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 305, in runresolver = self.make_resolver(File "/usr/lib/python3.9/site-packages/pip/_internal/cli/req_command.py", line 295, in make_resolverimport pip._internal.resolution.resolvelib.resolverFile "/usr/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 25, in <module>from .factory import FactoryFile "/usr/lib/python3.9/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 31, in <module>from .found_candidates import FoundCandidatesFile "/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: ignoreImportError: cannot import name 'collections_abc' from 'six.moves' (unknown location)And you’ve confirmed
sixis installed & up to date?The only think I can think of is downgrade the package.
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.
I have been having the same error since a couple of minutes...
I hit this same issues and I finally got it fixed! The issue is that the package
sixis not updated either in your user library or your system wide library. So you will need an updated version ofsix.pyin the following locations:/usr/lib/python3.9/site-packages/six.py~/.local/lib/python3.9/site-packages/six.pyAfter 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
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)
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 sixthen copy six from/usr/bin/pythonto your home library folderDeleted before we saved it.
Fixed the issue by manually replacing ~/.local/lib/python3.9/site-packages/six.py with https://raw.githubusercontent.com/benjaminp/six/master/six.py
I had the same problem and could only solve it by manually reinstalling python-six using my Distro's package manager.
Anyone has the same problem / a fix?
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.
ur right, updated it. Just ran: $ pip install numpy
I am having it. Happened after installing a random package. Since then pip is broken borth on user side and globally.