Re: [问题] 'numpy/arrayobject.h' file not found

楼主: ilms49898723 (LittleBird)   2019-08-13 08:54:07
因为导致那个错误的档案并不是同一个
只看这两行:
#include <Python.h>
#include <numpy/arrayobject.h>
(一)
Python.h在我的Case可以在/usr/include/python3.6/下找到,
因为Compiler通常都会找/usr/include,
所以你改成<Python/Python.h>可以Work
(我的case就要改成<python3.6/Python.h>)
(二)
但这样编译又跳出找不到Python.h,为什么?
因为那个Python.h的问题不在你的code,
在ndarrayobject.h (arrayobject.h有include这个档案),
很明显的直接去改这个档案是个很糟的做法,
所以我们就补上Python.h的位置资讯给他:
(路径请参照自己的改)
Add: /usr/include/python3.6
Add: /path/to/numpy/installation/core/include
(三)
这样就解释为什么你把include/去掉就找的到Python.h,
因为他找不到numpy/arrayobject.h,
自然不会有(二)
Compiler给的Message建议还是看完整不要只看结论XD
作者: Philethan (PE)   2019-08-13 16:32:00
大大您好,想请问该怎么知道Xcode compiler会找哪资料夹。感谢大大 我在想一下..

Links booklink

Contact Us: admin [ a t ] ucptt.com