1、安装bash, apt-get github,安装慢换源
2、安装下载的anaconda, sudo bash Anaconda3-2018.12-Linux-x86_64.sh
3、安装后关闭重新打开安装是否成功,conda -V
1)conda list 查看安装了哪些包。
2)conda env list 或 conda info -e 查看当前存在哪些虚拟环境
3)conda update conda 检查更新当前conda
4) conda remove -n your_env_name
5) 删除环境中的某个包, conda remove --name $your_env_name $package_name
4、创建Python虚拟环境激活
conda create -n your_env_name python=X.X(2.7、3.6等)
conda activate your_env_name --all
conda deactivate #如何关闭,不用再关闭
5、 换conda 源地址,
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
conda install 各种包
pip install 包 -i https://pypi.tuna.tsinghua.edu.cn/simple ,#换源没有管理员权限
网上还有这种操作添加源地址
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --set show_channel_urls yes
7、安装mxnet
mxnet-cu100,安装,先安装10.0 cuda,默认cudnn自动安装
1)conda install cudatoolkit=10.0 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-64/
2)pip install mxnet-cu100 -i https://pypi.douban.com/simple
或者
conda install mxnet-cu100
8、 安装pytorch,
conda install pytorch=0.3.0 torchvision=0.2.0
或者不指定版本
conda install pytorch=0.4.1 torchvision
9、安装环境依赖的包,可以用一个txt 文件列出,直接全部安装
pip install -r requirement.txt
requirement.txt 例如
Pillow
numpy==1.14.2
tqdm==4.19.4
scikit-image==0.13.0
scikit-learn==0.19.1
torchvision==0.2.0
scipy==0.19.0
matplotlib==2.0.2
10、一台机器安装挂载的路径下面nas,多个远程机器访问同个环境,操作
在本地安装的conda 有关路径,复制 (前提是路径一样)
vi ~/.bashrc
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/shiyy/nas/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/home/shiyy/nas/anaconda3/etc/profile.d/conda.sh" ]; then
. "/home/shiyy/nas/anaconda3/etc/profile.d/conda.sh"
else
export PATH="/home/shiyy/nas/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
在另一台电脑打开 vi ~/.bashrc,黏贴
然后 source ~/.bashrc