教你在ubuntu 18.04上docker安装Python3.7.5和MindSpore 1.1.1

就在张小白学习1.1.0版本的同时,MindSpore 悄然推出了1.1.1版本。

image.png

 

以往张小白都是用源码安装python 3.7.5,主要是因为ubuntu机器上不想安装docker。

但是现在docker这么流行,不玩一下也不大好,所以这次就用docker搞定这些事情吧。。。

 

docker安装前的准备工作

apt-get update

image.png

apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common

image.png

安装docker前设置apt-key

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –

image.png

sudo apt-key fingerprint 0EBFCD88

image.png

add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

image.png

安装docker-ce

apt-get install docker-ce

image.png

将docker加入系统启动

systemctl enable docker

systemctl start docker

image.png

检验docker安装

docker run hello-world

image.png

更新/etc/docker/daemon.json文件,进行docker的镜像设置,以便加速

image.png

更新后可以重启下docker。

systemctl restart docker

然后看一下目前docker的镜像情况:

docker images

拉取python的docker镜像

pull一个3.7.5的python镜像过来。

docker pull python:3.7.5

image.png

mkdir /data

mkdir /data/www

启动python容器:

docker run -p 8000:8000 -i -t -v /data/www:/www python:3.7.5 /bin/bash

image.png

根据MindSpore的安装指令安装mindspore 1.1.1

python -m pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/1.1.1/MindSpore/cpu/ubuntu_x86/mindspore-1.1.1-cp37-cp37m-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com -i https://pypi.tuna.tsinghua.edu.cn/simple

image.png

,,,

image.png

测试下是否正常安装:

image.png

 

我们返回到docker外面:

image.png

ubuntu系统还是mindspore 1.1.0的版本呢。。

posted @ 2021-12-14 17:12  MS小白  阅读(651)  评论(0)    收藏  举报