1. 程式人生 > >常用命令-python篇

常用命令-python篇

anaconda free mirror 常用 -s __name__ conda ann simple

1. pip 加速命令
pip install --index-url https://pypi.douban.com/simple

或者

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple
2. conda加速命令
  # 換用清華conda鏡像 
 conda config --prepend channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/ 
  # 也換用科大conda鏡像 
 conda config --prepend channels http://mirrors.ustc.edu.cn/anaconda/pkgs/free/
 conda config --set show_channel_urls yes 
 cat ~/.condarc #查看文件內容有無國內源信息,若有,則成功
3 添加python 路徑

export PYTHONPATH=/home/ye/setup/caffe-master/python:$PYTHONPATH

4 python 主函數頭
if __name__ == '__main__':
    main()

常用命令-python篇