question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot uninstall any package: `Pipx Internal Error: cannot find package {root_req.name!r} metadata.`

See original GitHub issue

Describe the bug I cannot use my packages after some upgrade:

$ pre-commit run --all
Traceback (most recent call last):
  File "/home/juanlu/.local/bin/pre-commit", line 5, in <module>
    from pre_commit.main import main
ModuleNotFoundError: No module named 'pre_commit'

so I went to see what was going on:

$ pipx list
venvs are in /home/juanlu/.local/pipx/venvs
apps are exposed on your $PATH at /home/juanlu/.local/bin
⚠️  package black[jupyter] has missing internal pipx metadata.
⚠️  package docker-compose has missing internal pipx metadata.
⚠️  package isort has missing internal pipx metadata.
⚠️  package nox has missing internal pipx metadata.
⚠️  package orchest-cli has missing internal pipx metadata.
⚠️  package pdm has missing internal pipx metadata.
⚠️  package pre-commit has missing internal pipx metadata.
⚠️  package rst-to-myst[sphinx] has missing internal pipx metadata.
⚠️  package tox==4.0.0b2 has missing internal pipx metadata.

One or more packages have a missing internal pipx metadata.
   They were likely installed using a pipx version before 0.15.0.0.
   Please uninstall and install these package(s) to fix.

But nothing worked:

$ pipx reinstall-all --verbose
pipx >(setup:729): pipx version is 1.0.0
pipx >(setup:730): Default python interpreter is '/usr/bin/python3'
pipx >(upgrade:91): Upgrading shared libraries in /home/juanlu/.local/pipx/shared
upgrading shared libraries...
pipx >(run_subprocess:172): running /home/juanlu/.local/pipx/shared/bin/python -m pip --disable-pip-version-check install --upgrade pip setuptools wheel
pipx >(run_subprocess:172): running <fetch_info_in_venv commands>
Pipx Internal Error: cannot find package {root_req.name!r} metadata.
pipx >(run_subprocess:172): running <fetch_info_in_venv commands>
Pipx Internal Error: cannot find package {root_req.name!r} metadata.
pipx >(run_subprocess:172): running <fetch_info_in_venv commands>
Pipx Internal Error: cannot find package {root_req.name!r} metadata.
pipx >(run_subprocess:172): running <fetch_info_in_venv commands>
Pipx Internal Error: cannot find package {root_req.name!r} metadata.
pipx >(run_subprocess:172): running <fetch_info_in_venv commands>
Pipx Internal Error: cannot find package {root_req.name!r} metadata.
pipx >(run_subprocess:172): running <fetch_info_in_venv commands>
Pipx Internal Error: cannot find package {root_req.name!r} metadata.
pipx >(run_subprocess:172): running <fetch_info_in_venv commands>
Pipx Internal Error: cannot find package {root_req.name!r} metadata.
pipx >(run_subprocess:172): running <fetch_info_in_venv commands>
Pipx Internal Error: cannot find package {root_req.name!r} metadata.
pipx >(run_subprocess:172): running <fetch_info_in_venv commands>
Pipx Internal Error: cannot find package {root_req.name!r} metadata.
The following package(s) failed to reinstall: pdm, docker-compose, tox==4.0.0b2, orchest-cli, isort, nox, rst-to-myst[sphinx], black[jupyter], pre-commit

Extra info:

$ /usr/bin/python3 -q
>>> import sys
>>> sys.path
['', '/usr/lib/python310.zip', '/usr/lib/python3.10', '/usr/lib/python3.10/lib-dynload', '/usr/local/lib/python3.10/dist-packages', '/usr/lib/python3/dist-packages', '/usr/lib/python3.10/dist-packages']
>>> 
$ ls -la /home/juanlu/.local/pipx/shared/bin/python
lrwxrwxrwx 1 juanlu juanlu 7 Aug 10 15:15 /home/juanlu/.local/pipx/shared/bin/python -> python3

Expected behavior Uninstall works.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
meowmeowmeowcatcommented, Aug 11, 2022

Actually reinstall-all won’t work in your case. This issue is a duplicate of #278.

0reactions
astrojuanlucommented, Aug 11, 2022

Well, my expectation is that a full reinstall will work 🙃 I was holding that off in case I could help uncover some underlying bug by digging a bit more. I’ll proceed with that solution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"pipx install" fails if PIP_TARGET env var is set #735 - GitHub
The problem is that if PIP_TARGET (or the equivalent target ... Pipx Internal Error: cannot find package {root_req.name!r} metadata. error.
Read more >
Troubleshooting - pipx
Troubleshooting · reinstall-all fixes most issues · Diagnosing problems using list · Specifying pipx options · Check for PIP_* environment variables · pipx...
Read more >
pip cannot uninstall <package>: "It is a distutils installed project"
This error means that this package's metadata doesn't include a list of files that belong to it. Most probably, you have installed this ......
Read more >
CumulusCI installation failed - Trailhead - Salesforce
CumulusCI installation failed, cannot uninstall to try again ... Pipx Internal Error: cannot find package {root_req.name!r} metadata.
Read more >
importlib-metadata - PyPI
Library to access the metadata for a Python package. This package supplies third-party access to the functionality of importlib.metadata including ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found