$ sudo gedit /etc/profile 添加: export PYTHONPATH=/path/to/caffe/python:$PYTHONPATH $ source /etc/profile # 使之生效 python import caffe