我尝试过:
pip3 install -r requirements.txt
这是我收到的错误:
Command "python setup.py egg_info" failed with error code 1 in
C:\Users\Admin\AppData\Local\Temp\pip-install-6c3rea1s\pycocotools\
You are using pip version 19.0.3, however version 20.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip'
command.
所以,我尝试了:
pip install --upgrade pip
和
install pip3 install -r requirements.txt
这导致了更多错误:
ERROR: Command errored out with exit status 1: command:
'c:\users\admin\appdata\local\programs\python\python37-32\python.exe'
-c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-epmkeh4g\\pycocotools\\setup.py'"'"';
__file__='"'"'C:\\Users\\Admin\\AppData\\Local\\Temp\\pip-install-epmkeh4g\\pycocotools\\setup.py'"'"';f=getattr(tokenize,
'"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
'"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
egg_info --egg-base
'C:\Users\Admin\AppData\Local\Temp\pip-install-epmkeh4g\pycocotools\pip-egg-info'
cwd:
C:\Users\Admin\AppData\Local\Temp\pip-install-epmkeh4g\pycocotools\
Complete output (5 lines): Traceback (most recent call last):
File "<string>", line 1, in <module> File
"C:\Users\Admin\AppData\Local\Temp\pip-install-epmkeh4g\pycocotools\setup.py",
line 2, in <module> from Cython.Build import cythonize
ModuleNotFoundError: No module named 'Cython'
---------------------------------------- ERROR: Command errored out
with exit status 1: python setup.py egg_info Check the logs for full
command output.
我删除了该文件夹并重新安装,但是结果保持不变。
答案 0 :(得分:2)
这是pycocotools中的错误。该错误已修复in 2017,但似乎该修复未在2018年发布到2.0版中(我认为发布过程也有问题)。
setup.py
中还有另一个类似的错误-它在安装之前先导入numpy
。
没有使用requirements.txt
来解决这些错误的简单方法。您需要先安装必需的模块,然后再安装pycocotools
:
pip install Cython numpy
pip install -r requirements.txt