1. 程式人生 > >COCO API: fatal error: Python.h: No such file or directory

COCO API: fatal error: Python.h: No such file or directory

我的系統為ubuntu 16.04

今天我在安裝tensorflow objection detection api的cocoapi的時候出現了下面的問題:

x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wfor
mat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.5/dist-packages/numpy/
core/include -I../common -I/usr/include/python3.5m -c pycocotools/_mask.c -o build/temp.linux-x86_64-3.5/pycocoto
ols/_mask.o -Wno-cpp -Wno-unused-function -std=c99                          
pycocotools/_mask.c:4:20: fatal error: Python.h: No such file or directory

發現網上csdn的辦法死活救不了我的問題,後面發現是我的python 3.5沒有安裝完全,輸入:

sudo apt-get install python3-dev

這樣弄一下,就可以了。

參考文獻

[1].tensorflow/models. https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/installation.md

[2].fatal error: Python.h: No such file or directory. https://stackoverflow.com/questions/21530577/fatal-error-python-h-no-such-file-or-directory