尝试使用此命令在 Windows 10 上安装 pycocotools
pip install git+https://github.com/philferriere/cocoapi.git#egg=pycocotools^&subdirectory=PythonAPI
收到此错误
Running setup.py install for pycocotools ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\tahse\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\tahse\\AppData\\Local\\Temp\\pip-install-mfa2au2j\\pycocotools_d30ec01c3a424919a7b7acbb341b39c9\\PythonAPI\\setup.py'"'"'; __file__='"'"'C:\\Users\\tahse\\AppData\\Local\\Temp\\pip-install-mfa2au2j\\pycocotools_d30ec01c3a424919a7b7acbb341b39c9\\PythonAPI\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\tahse\AppData\Local\Temp\pip-record-hpe_vmn_\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\tahse\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Include\pycocotools'
cwd: C:\Users\tahse\AppData\Local\Temp\pip-install-mfa2au2j\pycocotools_d30ec01c3a424919a7b7acbb341b39c9\PythonAPI
Complete output (13 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\pycocotools
copying pycocotools\coco.py -> build\lib.win-amd64-3.9\pycocotools
copying pycocotools\cocoeval.py -> build\lib.win-amd64-3.9\pycocotools
copying pycocotools\mask.py -> build\lib.win-amd64-3.9\pycocotools
copying pycocotools\__init__.py -> build\lib.win-amd64-3.9\pycocotools
running build_ext
building 'pycocotools._mask' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\tahse\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\tahse\\AppData\\Local\\Temp\\pip-install-mfa2au2j\\pycocotools_d30ec01c3a424919a7b7acbb341b39c9\\PythonAPI\\setup.py'"'"'; __file__='"'"'C:\\Users\\tahse\\AppData\\Local\\Temp\\pip-install-mfa2au2j\\pycocotools_d30ec01c3a424919a7b7acbb341b39c9\\PythonAPI\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\tahse\AppData\Local\Temp\pip-record-hpe_vmn_\install-record.txt' --single-version-externally-managed --user --prefix= --compile --install-headers 'C:\Users\tahse\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Include\pycocotools' Check the logs for full command output.
知道如何解决这个问题吗?