Deepin的python版本
Tofloor
poster avatar
mehandsomeboy
deepin
2020-01-08 04:18
Author
Deepin的这个python版本为什么是3.5而不是3.8啊? 能够升上去吗? 求告诉。还有就是我用了一条python3 -m pip install -U pip这个语句后,我的pip都不能用了是为什么呢?
Reply Favorite View the author
All Replies
avatar
zwt2020
deepin
2020-01-08 05:13
#1
想玩python最好用anaconda/miniconda
千万不要乱卸载系统自带,否则系统会挂掉
Reply View the author
avatar
zwt2020
deepin
2020-01-08 05:13
#2
想玩python最好用anaconda/miniconda
千万不要乱卸载系统自带,否则系统会挂掉
Reply View the author
avatar
134******40
deepin
2020-01-08 08:15
#3
deepin系统的好多基础软件太老了。
Reply View the author
avatar
mehandsomeboy
deepin
2020-01-08 15:33
#4
https://bbs.deepin.org/post/187781
想玩python最好用anaconda/miniconda
千万不要乱卸载系统自带,否则系统会挂掉

好的  我去试试
Reply View the author
avatar
Feng Yu
deepin
2020-01-08 19:29
#5
Debian的分包问题,同样也适用于Ubuntu。

当前版本下Debian/Ubuntu会同时包含python2和python3两个版本,按照分包策略,会分为python/python3两个包,python对应的/usr/bin/python,软连接到python2,而python3则对应/usr/bin/python3。所以在Debian/Ubuntu系统,使用python3命令运行才是系统的python3版本。同样按照Debian的尿性,喜欢把非必须组件以分包的形式拆开。比如你要使用pip或setuptool,还需要额外安装python-pip/python-setuptool或python3-pip/python3-setuptool等等,同样的,pip命令也会对应/usr/bin/pip和/usr/bin/pip3两个版本。

而Python2于今年结束维护,Ubuntu 20.04已经考虑彻底废弃掉python2及相关组件包,以后应该就不会这么麻烦了。

版本问题:
Debian/Ubuntu在稳定版本发布之后会冻结仓库,通常不会再升级被冻结后的软件版本,只会有一些小的BUG fix。这也就是你为什么看到Deepin的python3是3.5版本,因为它的上游来自于Debian 9,就是3.5版本的。自己也千万不要尝试去升级,因为python属于系统底层依赖,瞎搞会造成系统崩溃,对于新手小白来说修复几乎是不可能的任务。

如果你非要使用高版本不可,建议使用anaconda/miniconda,后者是精简版本,只带有conda命令和基本的python命令,无需root权限,不干扰系统环境,支持多版本共存,开发环境强烈推荐
Reply View the author
avatar
leafgreen
deepin
2020-01-08 20:47
#6
可以安装3.8,安装的时候用make altinstall (而不是make install),这样就不会覆盖系统的python。官方文档有解释,安装包里面的readme文档也有说。你可以参考https://docs.python.org/3/using/unix.html#getting-and-installing-the-latest-version-of-python

2.2. Building Python
If you want to compile CPython yourself, first thing you should do is get the source. You can download either the latest release’s source or just grab a fresh clone. (If you want to contribute patches, you will need a clone.)

The build process consists of the usual commands:

./configure
make
make install
Configuration options and caveats for specific Unix platforms are extensively documented in the README.rst file in the root of the Python source tree.

Warning make install can overwrite or masquerade the python3 binary. make altinstall is therefore recommended instead of make install since it only installs exec_prefix/bin/pythonversion.
Reply View the author
avatar
leafgreen
deepin
2020-01-08 20:52
#7
建议用源码安装前装个timeshift备份一下系统,搞坏了也可以回复。用miniconda也可以安装python3.8,用
  1. conda install python=3.8
Copy the Code
。还是建议用miniconda吧,不会搞坏系统,也容易安装和卸载。
Reply View the author