Installation broken with pip 10
luser opened this issue · comments
I had updated to pip 10.0.1 (to get rid of pip's update nag message), and then while trying to install a package that required chumpy its setup.py failed:
Collecting chumpy (from -r requirements.txt (line 5))
Downloading https://files.pythonhosted.org/packages/61/61/dc4e134b39674ecdd12a68139d2b82c4f9514133e023c070c973afced53a/chumpy-0.67.5.tar.gz (47kB)
100% |████████████████████████████████| 51kB 3.9MB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-ERtEwy/chumpy/setup.py", line 8, in <module>
from pip.req import parse_requirements
ImportError: No module named req
[This stackoverflow answer(https://stackoverflow.com/a/49867265/69326) has a suggested fix.
A (hotfix) pull request (#18) has been submitted for this issue.
This is happening lately because of a change in pip 10. StackOverFlow
setup.py:
"from pip.req import parse_requirements"
Change setup.py to something like:
try: # for pip >= 10
from pip._internal.req import parse_requirements
except ImportError: # for pip <= 9.0.3
from pip.req import parse_requirements
This was addressed in #18.
Hey @mattloper, this can be closed.