Skip to content

pip install error: ModuleNotFoundError: No module named 'pip.req'  #19

@kep-w

Description

@kep-w

when I use pip install python-kafka-logging, it alway get error like:
ERROR: Complete output from command python setup.py egg_info:
ERROR: Traceback (most recent call last):
File "", line 1, in
File "C:\Local\Temp\pip-install-wopvdc79\python-kafka-logging\setup.py", line 6, in
from pip.req import parse_requirements
ModuleNotFoundError: No module named 'pip.req'
----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in C:\Local\Temp\pip-install-wopvdc79\python-kafka-logging
I tried to update my pip, but no use.
Finally, i download the projoect, and change the 'setup.py' in line 6:
from "from pip.req import parse_requirements" to:
"try:
from pip._internal.req import parse_requirements
except ImportError:
from pip.req import parse_requirements
"
That can compatible with different pip versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions