Ubuntu 18.04 将python 版本切换为 python3.7

tutorials24x7installpython37ubuntu1804banner.jpg

环境准备

更新软件源缓存

apt update

安装 python3.7

apt install python3.7 python3-pip -y

配置

update-alternatives --install /usr/bin/python3 python3  /usr/bin/python3.7 100
# update-alternatives --query python3                                                                                              [1/1902]Name: python3                                                                                                                                                     Link: /usr/bin/python3
Status: auto
Best: /usr/bin/python3.7
Value: /usr/bin/python3.7

Alternative: /usr/bin/python3.7
Priority: 100
# python3 -V
Python 3.7.5

更新 pip

pip3 install --upgrade setuptools
python3 -m pip install --upgrade pip

安装自己的依赖

pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt

标题:Ubuntu 18.04 将python 版本切换为 python3.7
作者:糖醋鱼
地址:https://expoli.tech/articles/2022/05/30/1653917302720.html

    评论
    0 评论
avatar

取消