当前位置:   首页安装配置

在Docker中的ubuntu中安装Python3和Pip的问题

发布日期:2021-04-29 11:08 | 文章来源:源码之家

正文

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

到此这篇关于在Docker中的ubuntu中安装Python3和Pip的问题的文章就介绍到这了,更多相关Docker ubuntu安装Python3和Pip内容请搜索本站以前的文章或继续浏览下面的相关文章希望大家以后多多支持本站!

联系我们
关于使用场景和技术架构的更多咨询,请联系我们的销售和技术支持团队。
Yingsoo Host

在线
客服

在线客服:7*24小时在线

客服
热线

400-630-3752
7*24小时客服服务热线

关注
微信

关注官方微信
顶部