首页 > 服务器    日期:2021-03-11 / 浏览

正文

1)下载ubuntu镜像

docker pull ubuntu

2)查看镜像

docker images

3)运行容器

docker run -itd --name ubuntu-test ubuntu

4)进入容器

sudo docker exec -it ubuntu-test /bin/bash

5)更新源

apt-get update

如果不进行这一步的话,有可能会出现这样的问题:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package Python

运行一次即可

6)安装python3

apt-get install python3

7)安装pip3

 apt-get install python3-pip

8)测试

pip3 install numpy
Collecting numpy
 Downloading numpy-1.20.1-cp38-cp38-manylinux2010_x86_64.whl (15.4 MB)
   |████████████████████████████████| 15.4 MB 1.9 MB/s
Installing collected packages: numpy
Successfully installed numpy-1.20.1

觉得上面的内容有用吗?快来点个赞吧!

点赞() 我要打赏

温馨提示 : 本站内容来自会员投稿以及互联网,所有源码及教程均为作者总结编辑,请大家在使用过程中提前做好备份,以免发生无法预知的错误,源码类教程请勿直接用于生产环境!

 可能感兴趣的文章