python/caffe/_caffe.cpp:10:31: fatal error: numpy/arrayobject.h: No such file or directory
2017-11-17 17:21
561 查看
我在编译pycaffe的操作的时候,看见了下面的错误,编译命令为:
错误的输出为:
通过查阅资料,我的解决办法是:
然后运行命令:
然后加入环境变量,我的caffe路径为export PYTHONPATH=/home/whsyxt/Downloads/caffe/python:$PYTHONPATH:
成功了。
[2].Ubuntu16.4系统下为Python配置caffe环境.http://blog.csdn.net/u010417185/article/details/52065472
make pycaffe
错误的输出为:
CXX/LD -o python/caffe/_caffe.so python/caffe/_caffe.cpp python/caffe/_caffe.cpp:10:31: fatal error: numpy/arrayobject.h: No such file or directory compilation terminated. Makefile:507: recipe for target 'python/caffe/_caffe.so' failed make: *** [python/caffe/_caffe.so] Error 1
通过查阅资料,我的解决办法是:
sudo gedit Makefile.config
#找到这条语句,然后要加一个local: PYTHON_INCLUDE := /usr/include/python2.7 \ /usr/local/lib/python2.7/dist-packages/numpy/core/include
然后运行命令:
make pycaffe -j8输出为:
CXX/LD -o python/caffe/_caffe.so python/caffe/_caffe.cpp
然后加入环境变量,我的caffe路径为export PYTHONPATH=/home/whsyxt/Downloads/caffe/python:$PYTHONPATH:
sudo gedit ~/.bashrc #打开 export PYTHONPATH=/home/usrname/caffe/python:$PYTHONPATH #配置文件最后写入该路径, source ~/.bashrc #生效然后运行python,测试一下:
whsyxt@whsyxt:~/Downloads/caffe/python$ python Python 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import caffe >>> exit()
成功了。
参考文献
[1].编译 pycaffe时报错:fatal error: numpy/arrayobject.h没有那个文件或目录. http://blog.csdn.net/wuzuyu365/article/details/52430657[2].Ubuntu16.4系统下为Python配置caffe环境.http://blog.csdn.net/u010417185/article/details/52065472
相关文章推荐
- python/caffe/_caffe.cpp:10:31: fatal error: numpy/arrayobject.h: No such file or directory
- python/caffe/_caffe.cpp:10:31: fatal error: numpy/arrayobject.h: No such file or directory
- 配置caffe的python环境时make pycaffe提示fatal error: numpy/arrayobject.h No such file or directory解决方法
- Ubuntu caffe安装python/caffe/_caffe.cpp:1:52: fatal error: Python.h: No such file or directory
- 编译QtE出现qbytearray.cpp:52:18: fatal error: zlib.h: No such file or directory
- src/caffe/util/matio_io.cpp:10:19: fatal error: matio.h: No such file or directory compilation termi
- uwsgi部署web,error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory
- 阿里云服务器使用问题fatal error: Python.h: No such file or directory解决
- python/caffe/_caffe.cpp:47:31: fatal error: numpy/arrayobject.h: 没有那个文件或目录
- 安装python-ldap fatal error: lber.h: No such file or directory
- caffe : /wrap_python.hpp:50:23: fatal error: pyconfig.h: No such file or dir
- 阿里云服务器使用问题fatal error: Python.h: No such file or directory解决
- Linux下修复“fatal error: jsoncpp/json/json.h: No such file or directory” 分类: C++ | 标签: Linux,jsonjson
- Linux下修复“fatal error: jsoncpp/json/json.h: No such file or directory”
- 安装python-ldap fatal error: lber.h: No such file or directory
- 编译boost python模块遇到的错误:../../libraries/boost_1_44_0/boost/python/detail/wrap_python.hpp:75:24: fatal error: patchlevel.h: No such file or directory
- caffe时编译出错: fatal error: caffe/proto/caffe.pb.h: No such file or directory
- 使用bazel 编译tensorflow serving时报错:fatal error: Python.h: No such file or directory
- caffe编译:fatal error: pyconfig.h: No such file or directory #include "pyconfig.h"
- 安装pycrypto出现“fatal error: Python.h: No such file or directory”错误