python使用环境的设置

  1. download caffe
  2. change Makefile.config
  3. 3.
mkidr ~/pyenv   
cd ~/pyenv
virtualenv pycaffe  #it will setup a new python environtment named pycafffe 
.  pycaffe/bin/activate #it will activate your pycaffe dependent virtual environment( pycaffe in your shell )

deactiver    #leave your current python environment

第3步执行到. pycaffe/bin/activate ,进入pycaffe环境,接下来转第4步,

4.

mkdir ~/.pip
cd .pip   
vim pip.conf

and add flowing source address

[global]
index-url = https://mirrors.ustc.edu.cn/pypi/web/simple/

注意:由于来源可能较老,无法满足requirements.txt,需要更改其中的内容,去除IPython这一行,

~/caffe-master/python$ vim requirements.txt  #删除Ipython这一行
pip install --proxy proxy-prc.intel.com:912 -r requirements.txt
  1. make
~/caffe-master$ make pycaffe

6.
添加环境变量,方法1:

~/caffe-master/python$ export PYTHONPATH=/home/xiyangzh/caffe-master/python:$PYTHONPATH

方法2:
在bashrc中添加

vim ~/.bashrc  #添加一下语句
export PYTHONPATH=/home/xiyangzh/caffe-master/python:$PYTHONPATH
source ~/.bashrc

你可能感兴趣的:(computer,version)