Every package I try to install using pip, I get this error.

I already updated the pip but even so doesn't work

my pip version is 9.0.1

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2595, in _dep_map
    return self.__dep_map
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2457, 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/lib/python3/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 290, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/usr/lib/python3/dist-packages/pip/req.py", line 1266, in prepare_files
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2401, in requires
    dm = self._dep_map
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2597, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2621, in _compute_dependencies
    parsed = next(parse_requirements(distvers))
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2721, in parse_requirements
    "version spec")
  File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2686, in scan_list
    raise ValueError(msg, line, "at", line[p:])
ValueError: ('Expected version spec in', 'asgiref ~=1.1', 'at', ' ~=1.1')

Storing debug log for failure in /root/.pip/pip.log
  • 2
    The debug log the error references could be useful to include in your question.
    – Darth Vader
    Jun 20, 2017 at 7:01

1 Answer 1


There is a problem with one package version.

ValueError: ('Expected version spec in', 'asgiref ~=1.1', 'at', ' ~=1.1')

Show the version of pip and pip3:

sudo pip show pip


sudo pip3 show pip

Show all versions of your packages you installed with:

sudo pip freeze


sudo pip list

You already tried pip3?

Did you update the setuptools too?

sudo pip3 install -vU setuptools
  • Your diagnosis may be correct, but you have not clearly stated how to confirm this and correct it. Jun 20, 2017 at 15:40
  • Please take the tour and visit the helpcenter to see how things work here. Please note that comments should be used to solicit additional information from the OP of the question (that part should better not be in the answer). Feel free to edit along Steve's suggestion to improve your answer.
    – Ghanima
    Jun 20, 2017 at 17:33
  • My problem was, that I can't comment without 50 reputation. Im new on stackexchange, but I will to do it better in the future. Thanks for the hint with the tour and the helpcenter.
    – ElGammler
    Jun 21, 2017 at 6:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.