问题描述

~/Downloads/caffe$ python
Python 2.7.12 (default, Dec  4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import caffe
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named caffe

错误原因

主要是caffe中Python的配置路径有问题;

解决方法

~/Downloads/caffe$ sudo echo export PYTHONPATH="/home/xxx//Downloads/caffe/python" >> ~/.bashrc

特别注意配置路径更改为系统对应的路径;