(1)run一個容器
命令:podman run -v /your/path/:/work/ --name="cpython" --privileged=true --dns=8.8.8.8 -p 22002:22 -it docker.io/nvidia/cuda:10.2-cudnn8-devel-ubuntu16.04
(2)安裝python3.8
(2.1)讓管理員開通訪問外網權限
(2.2)查看系統版本信息:uname -a;cat /etc/issue;cat /proc/version
(2.3)ubuntu下,apt-get install python3.8,出現如下問題:
E: Unable to locate package python3.8-dev
E: Couldn't find any package by glob 'python3.8-dev'
E: Couldn't find any package by regex 'python3.8-dev'
解決辦法:
apt-get install -y software-properties-common
add-apt-repository ppa:deadsnakes/ppa(或者add-apt-repository ppa:jonathonf/python-3.8)
apt-get update
apt-get install python3.8
(3)設置python優先級
(3.1)查看python安裝路徑:which python3.8;
update-alternatives --config python
#通過update-alternatives來設置默認python版本, 最后的參數1,2是優先級,數字越大優先級越高
update-alternatives --install /usr/bin/python python /usr/bin/python3.5 1
update-alternatives --install /usr/bin/python python /usr/bin/python3.8 2
(4)安裝pip
(4.1)wget https://bootstrap.pypa.io/get-pip.py
解決:sudo apt-get install python3.8-distutils
(4.3)python3.8 get-pip.py
(4.4)查看版本:pip --version
(5)/usr/include/中沒有python3.8版本的Python.h
安裝:apt-get install python3.8-dev
