Hi, I just been trying to install a new pip module and I cannot. I’m getting the below error:
Traceback (most recent call last):
File "/usr/bin/pip", line 33, in <module>
sys.exit(load_entry_point('pip==20.1.1', 'console_scripts', 'pip')())
File "/usr/lib/python3.8/site-packages/pip/_internal/cli/main.py", line 73, in main
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
File "/usr/lib/python3.8/site-packages/pip/_internal/commands/__init__.py", line 104, in create_command
module = importlib.import_module(module_path)
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/usr/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 21, in <module>
from pip._internal.cache import WheelCache
File "/usr/lib/python3.8/site-packages/pip/_internal/cache.py", line 18, in <module>
from pip._internal.utils.temp_dir import TempDirectory, tempdir_kinds
File "/usr/lib/python3.8/site-packages/pip/_internal/utils/temp_dir.py", line 10, in <module>
from pip._vendor.contextlib2 import ExitStack
ModuleNotFoundError: No module named 'pip._vendor.contextlib2'
I’ve checked that python-contextlib2
is installed and it is there (it imports just fine in the python console) but pip can’t see it when attempting to install modules. It’s doing it for every package I can’t even run pip install --upgrade pip
. All that happens is I get the above output. I’ve tried removing and reinstalling pip and python with pacman and no luck.
From what I can find online this seems to be related to an issue with a pip upgrade. So I’ve then tried downgrading pip to V18.1 but I’m getting the same error on every version or an error about the correct version of pip not being present.
I’ve installed python and pip from the repositories so I’ve avoided trying to install manually with get-pip.py
to avoid creating other errors.
Any help would be greatly appreciated.