Linux从0安装深度学习环境

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档


前言

Linux从0安装深度学习环境


提示:以下是本篇文章正文内容,下面案例可供参考

一、所需材料

一台刚刚安装完成的debian系统的电脑

二、使用步骤

1.配置Debian系统

代码如下(示例):

su- 
nano /etc/sudoers
#在sudo ALL=(ALL:ALL) ALL 下面一行,xx为当前用户名
xx ALL=(ALL:ALL) ALL

2.系统换源

代码如下(示例):

nano /etc/apt/sources

修改换源,看清楚版本

#http://mirrors.163.com/debian/为软件源也可以为其他的 bullseye为版本代号 main non-free contrib区别如下
deb http://mirrors.163.com/debian/ bullseye main non-free contrib

deb http://mirrors.163.com/debian/ bullseye-updates main non-free contrib

deb http://mirrors.163.com/debian/ bullseye-backports main non-free contrib

deb-src http://mirrors.163.com/debian/ bullseye main non-free contrib

deb-src http://mirrors.163.com/debian/ bullseye-updates main non-free contrib

deb-src http://mirrors.163.com/debian/ bullseye-backports main non-free contrib

#deb http://mirrors.163.com/debian-security/ bullseye/updates main non-free contrib

#deb http://mirrors.ustc.edu.cn/debian-security/ bullseye/updates main non-free contrib

#deb-src http://mirrors.163.com/debian-security/ bullseye/updates main non-free contrib

#deb-src http://mirrors.ustc.edu.cn/debian-security/ bullseye/updates main non-free contrib

deb http://mirrors.ustc.edu.cn/debian-security/ stable-security main non-free contrib

deb-src http://mirrors.ustc.edu.cn/debian-security/ stable-security main non-free contrib

升级软件包、安装必要编译环境

sudo apt-get update/upgrade
sudo apt-get install build-essential

##3、安装anaconda

  1. 去清华镜像下载 anaconda 的软件包。下载地址
  2. 安装的时候输入 yes 就好,一直到安装结束
sudo dpkg install ‐i 

##4、在anaconda创建新环境

#这里的Python版本根据需要所订
2 conda create ‐n new_env python=3.9
3 conda activate new_env

##5、在新环境下安装Tensorflow

  1. 我们在激活一个新环境后需要对该环境的 conda 进行换源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
# 设置搜索时显示通道地址
conda config --set show_channel_urls yes

2)Tensoflow

conda install tensorflow

##6anaconda 新环境下安装 jupyter notebook

 conda install jupyter notebook
  conda   install ipykernel

其他问题总结

1、安装第三方包的时候有三种方法可以安装 conda、pip、poetry。最好避免 使用 pip 安装,因为会缺少很多依赖导致安装不成。因此应当首选 conda,其次 poetry(如果在开发文档给出该方法安装),最后在考虑pip安装。用pip安装时 一定要换源,具体使用方法pip install ‐i 包名 https://pypi.douban.com/ simple/
2、在出现问题No module name ’xxx’,这个问题有统一解决方法。
pip install xxx ‐i https://pypi.douban.com/simple/。如果这个方案依然解决不了,就说明缺少一些依赖。此时需要认真阅读相应出错地方,百度获取一些包的依赖。
3、在出问题的时候,overstackflow 是一个好网站,就是比较慢

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值