安装transpose 出现问题
No module named pip.req
C:\Users\yihe\PycharmProjects\zixue\venv\Scripts>pip install transpose
Collecting transpose
Using cached https://files.pythonhosted.org/packages/61/54/93f7fbacec4d5b576439a1354e0faae03e1200b
415b4f3be504c0bb454be/transpose-0.4.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\yihe\AppData\Local\Temp\pip-install-mgg23pmx\transpose\setup.py", line 3, in <m
odule>
from pip.req import parse_requirements
ModuleNotFoundError: No module named 'pip.req'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\yihe\AppData\Local\Temp\pip-
install-mgg23pmx\transpose\
analysis:
This is happening lately because of a change in pip 10.
The fix is pretty easy. You probably have something like:
from pip.req import parse_requirements
Change that 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
如果不知道在哪里更改:则降级pip
I downgraded to pip to 9.0.3 and things worked for me. Command for downgrading pip is
python -m pip install pip==9.0.3