栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

如何在Linux上使用sh文件一键安装anaconda环境

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

如何在Linux上使用sh文件一键安装anaconda环境

直接上例子start.sh

conda create -n wjntorch python=3.7 -y
source activate wjntorch
cd packages/
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 --set show_channel_urls yes
conda install ipykernel -y
python -m ipykernel install --user --name wjntorch --display-name "wjntorch" -y
pip3 install ordered_set
conda install seaborn -y
conda install statsmodels -y
conda install Jinja2 -y
# wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/linux-64/pytorch-1.7.1-py3.7_cuda10.2.89_cudnn7.6.5_0.tar.bz2
# wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/linux-64/torchvision-0.8.2-py37_cu102.tar.bz2
# wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/linux-64/torchaudio-0.7.2-py37.tar.bz2
# wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/linux-64/cudatoolkit-10.2.89-hfd86e86_1.conda
# wget https://data.pyg.org/whl/torch-1.7.0%2Bcu102/torch_scatter-2.0.7-cp37-cp37m-linux_x86_64.whl
conda install --use-local pytorch-1.7.1-py3.7_cuda10.2.89_cudnn7.6.5_0.tar.bz2 -y
conda install --use-local torchvision-0.8.2-py37_cu102.tar.bz2 -y
conda install --use-local torchaudio-0.7.2-py37.tar.bz2 -y
conda install --use-local cudatoolkit-10.2.89-hfd86e86_1.conda -y
conda install pytorch==1.7.1 torchvision==0.8.2 torchaudio==0.7.2 cudatoolkit=10.2 -c pytorch -y
pip3 install torch_scatter-2.0.7-cp37-cp37m-linux_x86_64.whl
  • -y是为了在安装过程中跳过确认环节,一路畅通无阻
  • 为了让source命令正常执行,请按bash start.sh执行文件
  • 为了让安装过程坐上火箭可以加入清华源
  • 一些比较大的包可以用wget命令先下载到本地,然后用conda或者是pip本地化安装
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/355598.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号