Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip3 install docker exception AttributeError: _DistInfoDistribution__dep_map Fedora 34 #10561

Closed
1 task done
SomePersonSomeWhereInTheWorld opened this issue Oct 8, 2021 · 7 comments
Labels
resolution: duplicate Duplicate of an existing issue/PR

Comments

@SomePersonSomeWhereInTheWorld

Description

pip 20.2.2, Python 3.7.3, Fedora 34, running pip3 install docker results in the below:

pip3 install docker
Collecting docker
  Downloading docker-5.0.3-py2.py3-none-any.whl (146 kB)
     |████████████████████████████████| 146 kB 18.9 MB/s
Requirement already satisfied: requests!=2.18.0,>=2.14.2 in /usr/local/bin/anaconda3/lib/python3.7/site-packages (from docker) (2.26.0)
Collecting websocket-client>=0.32.0
  Downloading websocket_client-1.2.1-py2.py3-none-any.whl (52 kB)
     |████████████████████████████████| 52 kB 3.4 MB/s
Requirement already satisfied: idna<4,>=2.5; python_version >= "3" in /usr/local/bin/anaconda3/lib/python3.7/site-packages (from requests!=2.18.0,>=2.14.2->docker) (2.10)
Requirement already satisfied: charset-normalizer~=2.0.0; python_version >= "3" in /usr/local/bin/anaconda3/lib/python3.7/site-packages (from requests!=2.18.0,>=2.14.2->docker) (2.0.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/bin/anaconda3/lib/python3.7/site-packages (from requests!=2.18.0,>=2.14.2->docker) (1.25.10)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/bin/anaconda3/lib/python3.7/site-packages (from requests!=2.18.0,>=2.14.2->docker) (2020.6.20)
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 "/usr/local/bin/anaconda3/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3021, in _dep_map
    return self.__dep_map
  File "/usr/local/bin/anaconda3/lib/python3.7/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 "/usr/local/bin/anaconda3/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3012, in _parsed_pkg_info
    return self._pkg_info
  File "/usr/local/bin/anaconda3/lib/python3.7/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 "/usr/local/bin/anaconda3/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 535, in _determine_conflicts
    return check_install_conflicts(to_install)
  File "/usr/local/bin/anaconda3/lib/python3.7/site-packages/pip/_internal/operations/check.py", line 108, in check_install_conflicts
    package_set, _ = create_package_set_from_installed()
  File "/usr/local/bin/anaconda3/lib/python3.7/site-packages/pip/_internal/operations/check.py", line 50, in create_package_set_from_installed
    package_set[name] = PackageDetails(dist.version, dist.requires())
  File "/usr/local/bin/anaconda3/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2736, in requires
    dm = self._dep_map
  File "/usr/local/bin/anaconda3/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3023, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/usr/local/bin/anaconda3/lib/python3.7/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 "/usr/local/bin/anaconda3/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3014, in _parsed_pkg_info
    metadata = self.get_metadata(self.PKG_INFO)
  File "/usr/local/bin/anaconda3/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1420, in get_metadata
    value = self._get(path)
  File "/usr/local/bin/anaconda3/lib/python3.7/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: '/usr/local/bin/anaconda3/lib/python3.7/site-packages/toml-0.10.1.dist-info/METADATA'
Installing collected packages: websocket-client, docker
Successfully installed docker-5.0.3 websocket-client-1.2.1

Expected behavior

no error

pip version

20.2.2

Python version

3.7.7

OS

Fedora 34

How to Reproduce

pip3 install docker

Output

No response

Code of Conduct

@SomePersonSomeWhereInTheWorld SomePersonSomeWhereInTheWorld added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Oct 8, 2021
@DiddiLeija
Copy link
Member

DiddiLeija commented Oct 8, 2021

I think I saw this issue before and it was fixed on a newer release. Can you update your pip version?

@DiddiLeija DiddiLeija added the S: awaiting response Waiting for a response/more information label Oct 8, 2021
@DiddiLeija
Copy link
Member

Actually, this is a duplicate of #8676.

@DiddiLeija DiddiLeija added resolution: duplicate Duplicate of an existing issue/PR and removed type: bug A confirmed bug or unintended behavior S: awaiting response Waiting for a response/more information S: needs triage Issues/PRs that need to be triaged labels Oct 8, 2021
@SomePersonSomeWhereInTheWorld
Copy link
Author

      Successfully uninstalled pip-20.2.2
Successfully installed pip-21.2.4

pip3 install toml
Requirement already satisfied: toml in /usr/local/bin/anaconda3/lib/python3.7/site-packages (0.10.1)
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/usr/local/bin/anaconda3/lib/python3.7/site-packages/toml-0.10.1.dist-info/METADATA'

@DiddiLeija
Copy link
Member

As I read on #8676, I recommend you to read #8676 (comment) for more information.

@SomePersonSomeWhereInTheWorld
Copy link
Author

As I read on #8676, I recommend you to read #8676 (comment) for more information.

Yes that worked now getting a different error:

    Found existing installation: ruamel-yaml 0.15.87
ERROR: Cannot uninstall 'ruamel-yaml'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

@DiddiLeija
Copy link
Member

This may be caused by a badly installed ruamel-yaml (via distutils). Can you try to delete it and try again?

@SomePersonSomeWhereInTheWorld
Copy link
Author

This may be caused by a badly installed ruamel-yaml (via distutils). Can you try to delete it and try again?

Yes had to rm /usr/local/bin/anaconda3/lib/python3.7/site-packages/ruamel_yaml-0.15.87-py3.7.egg-info and rm -rf /usr/local/bin/anaconda3/lib/python3.7/site-packages/ruamel_yaml then reinstall worked.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolution: duplicate Duplicate of an existing issue/PR
Projects
None yet
Development

No branches or pull requests

2 participants