在Docker中的ubuntu中安装Python3和Pip
生活随笔
收集整理的這篇文章主要介紹了
在Docker中的ubuntu中安装Python3和Pip
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
目錄
文章目錄
- 目錄
- 正文
- 1)下載ubuntu鏡像
- 2)查看鏡像
- 3)運行容器
- 4)進入容器
- 5)更新源
- 6)安裝python3
- 7)安裝pip3
- 8)測試
正文
1)下載ubuntu鏡像
docker pull ubuntu2)查看鏡像
docker images3)運行容器
docker run -itd --name ubuntu-test ubuntu4)進入容器
sudo docker exec -it ubuntu-test /bin/bash5)更新源
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 python37)安裝pip3
apt-get install python3-pip8)測試
pip3 install numpy Collecting numpyDownloading 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的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 学JAVA要学redis_新手学习Jav
- 下一篇: python开发项目架构图_我的第一个p