在Docker中的ubuntu中安裝Python3和Pip的問題
正文
1)下載ubuntu鏡像
docker pull ubuntu
2)查看鏡像
docker images
3)運(yùn)行容器
docker run -itd --name ubuntu-test ubuntu
4)進(jìn)入容器
sudo docker exec -it ubuntu-test /bin/bash
5)更新源
apt-get update
如果不進(jìn)行這一步的話,有可能會(huì)出現(xiàn)這樣的問題:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package Python
運(yùn)行一次即可
6)安裝python3
apt-get install python3
7)安裝pip3
apt-get install python3-pip
8)測(cè)試
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
到此這篇關(guān)于在Docker中的ubuntu中安裝Python3和Pip的問題的文章就介紹到這了,更多相關(guān)Docker ubuntu安裝Python3和Pip內(nèi)容請(qǐng)搜索本站以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持本站!
版權(quán)聲明:本站文章來源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請(qǐng)保持原文完整并注明來源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非maisonbaluchon.cn所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學(xué)習(xí)參考,不代表本站立場(chǎng),如有內(nèi)容涉嫌侵權(quán),請(qǐng)聯(lián)系alex-e#qq.com處理。
關(guān)注官方微信