在 Raspbian Buster 上将 Python 3.7 降级到 3.5

新手上路,请多包涵

因此,Buster 似乎默认加载了 2.7 版和替代的 3.7 版 Python。但是,我将这个 Raspberry Pi 3 B+ 用于仅与 Python 3.5 兼容的应用程序。如何将 Python 3.5 作为默认版本运行或从 Buster 中完全删除 3.7?

原文由 Stigma 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 771
1 个回答

我真的相信你可以从源代码库安装 python3.5。

如果你想安装 python 3.5.4 :

sudo apt-get install python3.5

如果你想安装 python 3.5.3 (Debian Stretch):

以 root 身份编辑 /etc/apt/source.list 并添加以下 repos,

deb http://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free

rpi firmware deb http://archive.raspberrypi.org/debian/ stretch main ui

然后使用以下命令从目标仓库安装特定的包版本:

sudo apt-get install python3.5 -t stretch

如果想安装 pip3.5(我猜你需要):

wget https://bootstrap.pypa.io/get-pip.py

python3.5 ./get-pip.py

原文由 Sourindu Chatterjee 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题