Daniel Tam
Daniel Tam

Reputation: 926

Unable to Use python-pip command on Linux Manjaro

So I recently just bought a Raspberry Pi 4, flashed Linux Manjaro XFCE onto it and booted it up. I managed to install python-pip with Pacman without any errors but when I actually try to use the command, I get this error.

Traceback (most recent call last):
  File "/usr/bin/pip", line 33, in <module>
    sys.exit(load_entry_point('pip==20.3.4', 'console_scripts', 'pip')())
  File "/usr/bin/pip", line 22, in importlib_load_entry_point
    for entry_point in distribution(dist_name).entry_points
  File "/usr/lib/python3.8/importlib/metadata.py", line 504, in distribution
    return Distribution.from_name(distribution_name)
  File "/usr/lib/python3.8/importlib/metadata.py", line 177, in from_name
    raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: pip

I've tried reinstalling it many times but it still doesn't work. This is what comes out while I install it.

resolving dependencies...
looking for conflicting packages...

Packages (1) python-pip-20.3.4-1

Total Installed Size:  1.60 MiB

:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring                                                                                     [####################################################################] 100%
(1/1) checking package integrity                                                                                   [####################################################################] 100%
(1/1) loading package files                                                                                        [####################################################################] 100%
(1/1) checking for file conflicts                                                                                  [####################################################################] 100%
(1/1) checking available disk space                                                                                [####################################################################] 100%
:: Processing package changes...
(1/1) installing python-pip                                                                                        [####################################################################] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...

Do take note that I'm a complete Linux noob and have recently just started using it.

One more thing to add, I already have Python installed on this and its version is Python 3.8.5. Just in case anyone needs that information.

Upvotes: 3

Views: 6571

Answers (1)

Nils Fenner
Nils Fenner

Reputation: 151

Encountered a related issue today without finding a good description about how to recover from such situation. Soo… Here's a "porr man's" solution to that:

pamac reinstall python-pip

If that's not enough and you have accidentally removed some or all of Manjaro's system Python packages, reinstall them one by one:

pamac reinstall python-<MISSING-MODULE>

Example: pamac reinstall python-pip python-packaging python-chardet python-urllib3 …

If even pamac is not available, replace the command with pacman:

sudo pacman -S python-<module-name>

If someone finds a better way, please share! Happy trouble-shooting! :)

Upvotes: 1

Related Questions