Docker环境配置

Docker 环境搭建

1、 先更新apt-get

sudo apt-get update
sudo apt-get upgrade

2、更新apt-get的下载源

sudo vim /etc/apt/sources.list

​ 修改sources.list的内容为下面的设置

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

​ 若是LTS 18.04 则需将xenial换成bionic

3、 再更新一下apt-get

sudo apt-get update
sudo apt-get upgrade

4、 安装python3

sudo apt-get install python3

5、安装pip3

sudo apt-get install python3-pip
sudo pip3 install --upgrade pip

如果遇到问题,请参考problem

6、更新pip3的下载源

mkdir ~/.pip
cd ~/.pip/
vim pip.conf

​ 修改pip.conf的内容为下面的设置

[global] 
index-url = http://mirrors.aliyun.com/pypi/simple/ 
[install] 
trusted-host=mirrors.aliyun.com 

7、安装一些常用的包

pip3 install numpy scipy pandas matplotlib sklearn opencv-python tqdm

8、安装pytorch

pip3 install torch torchvision

​ 这里看网速,网速慢建议先去官网下载好了,然后在本地进行安装

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值