安裝pycocotools報無效的數值參數“/Wno-cpp”錯誤


win7 sp1 + vs2019環境下執行pip install 'git+https://github.com/cocodataset/cocoapi.git#subdirectory=PythonAPI'報出

cl: 命令行 error D8021 :無效的數值參數“/Wno-cpp”

錯誤。

解決方法:

首先執行

git clone https://github.com/cocodataset/cocoapi.git

然后cd到PythonAPI目錄下。

修改setup.py文件。

將
extra_compile_args=['-Wno-cpp', '-Wno-unused-function', '-std=c99'],
改為
extra_compile_args=['-std=c99'],

保存后執行

python setup.py build_ext --inplace
python setup.py build_ext install


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM