作者ilms49898723 (LittleBird)
看板C_and_CPP
标题Re: [问题] 'numpy/arrayobject.h' file not found
时间Tue Aug 13 08:54:07 2019
因为导致那个错误的档案并不是同一个
只看这两行:
#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
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 70.168.101.208 (美国)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/C_and_CPP/M.1565657649.A.061.html
※ 编辑: ilms49898723 (70.168.101.208 美国), 08/13/2019 08:54:42
※ 编辑: ilms49898723 (70.168.101.208 美国), 08/13/2019 08:56:39
※ 编辑: ilms49898723 (70.168.101.208 美国), 08/13/2019 08:59:11
1F:→ Philethan: 大大您好,想请问该怎麽知道Xcode compiler会找哪资料 08/13 16:32
2F:→ Philethan: 夹。 08/13 16:32
3F:推 Philethan: 感谢大大 我在想一下.. 08/13 16:35