【机器学习】Python开发环境配置-Ubuntu18

本文详细介绍了如何在Ubuntu18系统中配置机器学习开发环境,包括设置国内源、安装基础软件、使用Anaconda管理Python环境、安装Node.js、配置JupyterHub+Lab多用户云notebook环境以及安装Pytorch和CUDA,为深度学习提供GPU支持。整个过程包括conda的安装与管理、JupyterLab的使用以及CUDA和cuDNN的安装步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


一、系统环境

本机操作系统版本为:
Ubuntu 18.04.6 LTS (Bionic Beaver)

二、设置国内源

阿里云:

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

清华源:

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

三、安装基础软件

  1. 搜狗拼音输入法,参考:
    全网最详尽Ubuntu18安装搜狗输入法教程
    官方搜狗安装指南
    注意:可能出现无法输入中文的问题,可以通过重启fcitx来检查是否缺少什么依赖库
    fcitx restart&
    
  2. 在Ubuntu软件商店里安装git, vscode, postman等常用软件

四、Anaconda

1. 安装conda

官网下载安装脚本,对应python3.9,并执行脚本进行安装:

wget https://repo.anaconda.com/archive/Anaconda3-2022.05-Linux-x86_64.sh
# 修改运行权限
chmod +x Anaconda3-2022.05-Linux-x86_64.sh
# 安装到/usr/local/anaconda3目录下,便于多用户使用
sudo ./Anaconda3-2022.05-Linux-x86_64.sh

2. 常用conda命令

#  初始化conda运行环境,可以在root以及新用户环境下运行该命令进行环境
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值