执行两条指令就可以正确安装
首先:conda install git
然后:pip install "git+https://github.com/philferriere/cocoapi.git#egg=pycocotools&subdirectory=PythonAPI"
Collecting pycocotools
Using cached https://files.pythonhosted.org/packages/96/84/9a07b1095fd8555ba3f3d519517c8743c2554a245f9476e5e39869f948d2/pycocotools-2.0.0.tar.gz
Building wheels for collected packages: pycocotools
Running setup.py bdist_wheel for pycocotools ... error
Complete output from command C:\Anaconda3\envs\rsl_env\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-rgg_uzgn\\pycocotools\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\User~1\AppData\Local\Temp\pip-wheel-4gdx7emo --python-tag cp35:
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.5
creating build\lib.win-amd64-3.5\pycocotools
copying pycocotools\coco.py -> build\lib.win-amd64-3.5\pycocotools
copying pycocotools\cocoeval.py -> build\lib.win-amd64-3.5\pycocotools
copying pycocotools\mask.py -> build\lib.win-amd64-3.5\pycocotools
copying pycocotools\__init__.py -> build\lib.win-amd64-3.5\pycocotools
running build_ext
building 'pycocotools._mask' extension
creating build\temp.win-amd64-3.5
creating build\temp.win-amd64-3.5\Release
creating build\temp.win-amd64-3.5\Release\pycocotools
creating build\temp.win-amd64-3.5\Release\common
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Anaconda3\envs\rsl_env\lib\site-packages\numpy\core\include -Icommon -IC:\Anaconda3\envs\rsl_env\include -IC:\Anaconda3\envs\rsl_env\include /Tcpycocotools/_mask.c /Fobuild\temp.win-amd64-3.5\Release\pycocotools/_mask.obj -Wno-cpp -Wno-unused-function -std=c99
cl : Command line error D8021 : invalid numeric argument '/Wno-cpp'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\cl.exe' failed with exit status 2
----------------------------------------
Failed building wheel for pycocotools
Running setup.py clean for pycocotools
Failed to build pycocotools
Installing collected packages: pycocotools
Running setup.py install for pycocotools ... error
Complete output from command C:\Anaconda3\envs\rsl_env\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\USER~1\\AppData\\Local\\Temp\\pip-install-rgg_uzgn\\pycocotools\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\USER~1\AppData\Local\Temp\pip-record-t1cjvr_9\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.5
creating build\lib.win-amd64-3.5\pycocotools
copying pycocotools\coco.py -> build\lib.win-amd64-3.5\pycocotools
copying pycocotools\cocoeval.py -> build\lib.win-amd64-3.5\pycocotools
copying pycocotools\mask.py -> build\lib.win-amd64-3.5\pycocotools
copying pycocotools\__init__.py -> build\lib.win-amd64-3.5\pycocotools
running build_ext
building 'pycocotools._mask' extension
creating build\temp.win-amd64-3.5
creating build\temp.win-amd64-3.5\Release
creating build\temp.win-amd64-3.5\Release\pycocotools
creating build\temp.win-amd64-3.5\Release\common
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Anaconda3\envs\rsl_env\lib\site-packages\numpy\core\include -Icommon -IC:\Anaconda3\envs\rsl_env\include -IC:\Anaconda3\envs\rsl_env\include /Tcpycocotools/_mask.c /Fobuild\temp.win-amd64-3.5\Release\pycocotools/_mask.obj -Wno-cpp -Wno-unused-function -std=c99
cl : Command line error D8021 : invalid numeric argument '/Wno-cpp'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\cl.exe' failed with exit status 2