Wednesday, 11 November 2020

pip2: ImportError: cannot import name RequirementParseError

I can't pip2 get working.

I need pip2 as I need to use an older tensorflow version which is not supported by python3 pip. When trying to run pip2 install I get this:

Traceback (most recent call last):
  File "/usr/bin/pip2", line 11, in <module>
    load_entry_point('pip==20.1.1', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/site-packages/pip/_internal/cli/main.py", line 73, in main
    command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
  File "/usr/lib/python2.7/site-packages/pip/_internal/commands/__init__.py", line 104, in create_command
    module = importlib.import_module(module_path)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/lib/python2.7/site-packages/pip/_internal/commands/install.py", line 24, in <module>
    from pip._internal.cli.req_command import RequirementCommand, with_cleanup
  File "/usr/lib/python2.7/site-packages/pip/_internal/cli/req_command.py", line 21, in <module>
    from pip._internal.req.constructors import (
  File "/usr/lib/python2.7/site-packages/pip/_internal/req/constructors.py", line 21, in <module>
    from pip._vendor.pkg_resources import RequirementParseError, parse_requirements
ImportError: cannot import name RequirementParseError

I uninstalled pip2 and reinstalled it. Also did the same for pip(3). But this didn't change a thing. I could not find anything useful on this error message and feel a bit helpless. Any ideas?

update forgot to mention, that I use archlinux. I installed it with pacman -S python2-pip



from pip2: ImportError: cannot import name RequirementParseError

No comments:

Post a Comment