1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| 1. 添加conda环境变量 sudo gedit ~/.bashrc
在文件中添加如下配置: # >>> conda initialize >>> # !! Contents within this block are managed by 'conda init' !! __conda_setup="$('/home/hust1008/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)" if [ $? -eq 0 ]; then eval "$__conda_setup" else if [ -f "/home/hust1008/anaconda3/etc/profile.d/conda.sh" ]; then . "/home/hust1008/anaconda3/etc/profile.d/conda.sh" else export PATH="/home/hust1008/anaconda3/bin:$PATH" fi fi unset __conda_setup # <<< conda initialize <<< # export PYTHONPATH=/mnt2/zhangjinpu/CODE/CenSiam:$PYTHONPATH
export PATH=/usr/local/cuda/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
2. 修改conda环境保存路径 换源 sudo gedit ~/.condarc
添加: channels:
- defaults show_channel_urls: true default_channels: - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r custom_channels: conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud envs_dirs: - /home/changruowang/.conda/envs pkgs_dirs: - /home/changruowang/.conda/pkgs
|