1.vim ~/.bashrc 2.往.bashrc中加上:sudo echo export PYTHONPATH="~/caffe/python" >> ~/.bashrc 3.source ~/.bashrc # 使环境变量生效