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.

'METADATA' crash during 'pip install'

See original GitHub issue
  • pip version:20.2
  • Python version:3.8.4
  • Operating system:windows 10
C:\Users\elcot>pip install scipy
Requirement already satisfied: scipy in c:\users\elcot\appdata\local\programs\python\python38\lib\site-packages (1.4.1)
Requirement already satisfied: numpy>=1.13.3 in c:\users\elcot\appdata\roaming\python\python38\site-packages (from scipy) (1.19.0)
ERROR: Error while checking for conflicts. Please file an issue on pip's issue tracker: https://github.com/pypa/pip/issues/new
Traceback (most recent call last):
  File "c:\users\elcot\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3021, in _dep_map
    return self.__dep_map
  File "c:\users\elcot\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2815, in __getattr__
    raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\elcot\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3012, in _parsed_pkg_info
    return self._pkg_info
  File "c:\users\elcot\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2815, in __getattr__
    raise AttributeError(attr)
AttributeError: _pkg_info

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\elcot\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\commands\install.py", line 535, in _determine_conflicts
    return check_install_conflicts(to_install)
  File "c:\users\elcot\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\operations\check.py", line 108, in check_install_conflicts
    package_set, _ = create_package_set_from_installed()
  File "c:\users\elcot\appdata\local\programs\python\python38\lib\site-packages\pip\_internal\operations\check.py", line 50, in create_package_set_from_installed
    package_set[name] = PackageDetails(dist.version, dist.requires())
  File "c:\users\elcot\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2736, in requires
    dm = self._dep_map
  File "c:\users\elcot\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3023, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "c:\users\elcot\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3032, in _compute_dependencies
    for req in self._parsed_pkg_info.get_all('Requires-Dist') or []:
  File "c:\users\elcot\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3014, in _parsed_pkg_info
    metadata = self.get_metadata(self.PKG_INFO)
  File "c:\users\elcot\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 1420, in get_metadata
    value = self._get(path)
  File "c:\users\elcot\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 1616, in _get
    with open(path, 'rb') as stream:
PermissionError: [Errno 13] Permission denied: 'c:\\users\\elcot\\appdata\\roaming\\python\\python38\\site-packages\\astroid-2.4.2.dist-info\\METADATA'

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:30 (17 by maintainers)

github_iconTop GitHub Comments

6reactions
uranusjrcommented, Dec 22, 2020

Here’s some context for people landing in this issue. The error is generated during the “integrity check” phase after packages are installed, and the fact that you hit this indicates that the packages you want have all been correctly installed. You can safely ignore this message if you must.

The easiest way to work around the error is to delete the offending .dist-info directory in your environment. The last line of the error message should contain something like

FileNotFoundError: No such file or directory: /some/path/to/package-version.dist-info/METADATA

Steps to recover:

  • Delete the displayed package-version.dist-info directory
  • pip install --force-reinstall package==version

Update: The most likely cause to this issue is you installed the offending package with pip, but than uninstalled it with conda. This has been reported in conda/conda#10357; please drop a word there to let Conda maintainers know this is an issue.

5reactions
pradyunsgcommented, Oct 18, 2020

This is released as part of pip 20.2.4 now. Upgrading to the newest pip will include the fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - pip has problems with metadata - Stack Overflow
I'm running now: pip install -U pip and getting: (...) has inconsistent version: filename has '22.1.2', but metadata has '22.1.2' and pip goes ......
Read more >
crash of METADATA file cannot be fixed by reinstall of python
msg335060 ‑ (view) Author: Feștilă George Cătălin (catafest) Date: 2019‑02‑08 07:59 msg335062 ‑ (view) Author: Feștilă George Cătălin (catafest) Date: 2019‑02‑08 08:35 msg335063 ‑ (view)...
Read more >
metadata-generation-failed pip - You.com | The AI Search ...
On Ubuntu 22.04, the newest LTS distrib, pip install . (or python setup.py install) on the source code crashes with an odd message...
Read more >
Package installation issues | PyCharm Documentation
The most viable troubleshooting action is to try installing the problematic package on the selected Python interpreter using the terminal. If you get...
Read more >
sdv - PyPI
Install. Using pip : pip install sdv. Using conda : conda install -c pytorch -c ... In the first step, we will load...
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