1

Whenever I try to install a pip package (pip install <package_name>), I will get the error message below. However, the package still gets installed successfully.

I'm using python 3.7.

ERROR: Error checking for conflicts.
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3021, in _dep_map
    return self.__dep_map
  File "C:\ProgramData\Anaconda3\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:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3012, in _parsed_pkg_info
    return self._pkg_info
  File "C:\ProgramData\Anaconda3\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:\ProgramData\Anaconda3\lib\site-packages\pip\_internal\commands\install.py", line 512, in _warn_about_conflicts
    package_set, _dep_info = check_install_conflicts(to_install)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_internal\operations\check.py", line 114, in check_install_conflicts
    package_set, _ = create_package_set_from_installed()
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_internal\operations\check.py", line 53, in create_package_set_from_installed
    package_set[name] = PackageDetails(dist.version, dist.requires())
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2736, in requires
    dm = self._dep_map
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3023, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "C:\ProgramData\Anaconda3\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:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3014, in _parsed_pkg_info
    metadata = self.get_metadata(self.PKG_INFO)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 1420, in get_metadata
    value = self._get(path)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 1616, in _get
    with open(path, 'rb') as stream:
FileNotFoundError: [Errno 2] No such file or directory: 'c:\\programdata\\Anaconda3\\lib\\site-packages\\numpy-1.18.4.dist-info\\METADATA'
user3848207
  • 3,737
  • 17
  • 59
  • 104
  • Are you consciously using anaconad? – Nearoo Jun 11 '20 at 07:28
  • @Nearoo, I'm using anaconda python. Some packages can't be found on conda, so I used pip. – user3848207 Jun 11 '20 at 07:37
  • Related - [Could not install packages due to an EnvironmentError: Errno 2 No such file or directory \\METADATA](https://stackoverflow.com/questions/54778630/could-not-install-packages-due-to-an-environmenterror-errno-2-no-such-file-or) as well as https://github.com/googleapis/google-cloud-python/issues/6647#issuecomment-441425430 – shad0w_wa1k3r Jun 11 '20 at 07:39
  • Did you check if it relay missing, meaning numpy-1.18.4.dist-info\\METADATA exist in the folder?from my past experience with issues like that , i had to remove the instillation and re install it(numpy in your case) and it solved the problem. – Nir Elbaz Jun 11 '20 at 07:40

1 Answers1

0

Downgrade the version of testpath:

conda install 'testpath<0.4'

More details on the issue: https://github.com/conda-forge/testpath-feedstock/issues/7

Arslan
  • 400
  • 1
  • 3
  • 10