装的时候运行了一个apt autoremove python3.6 直接搞崩了系统上不了网了,直接重装了系统,还是要小心啊。
sudo apt-get install --reinstall ubuntu-desktop
目录
1. 安装python3.10 及 对应的pip
需要注意的是如果直接apt-get install python3-pip
的话装的不是对应的3.10版本的,可能会导致多个问题。
1.1安装通用软件依赖
sudo apt install software-properties-common
1.2 添加Ubuntu的python版本 所在的库:
sudo add-apt-repository ppa:deadsnakes/ppa
执行后看一下输出,输出会告诉我们需要做什么:
ltt@ltt-E440:~$ sudo add-apt-repository ppa:deadsnakes/ppa
This PPA contains more recent Python versions packaged for Ubuntu.
Disclaimer: there's no guarantee of timely updates in case of security problems or other issues. If you want to use them in a security-or-otherwise-critical environment (say, on a production server), you do so at your own risk.
Update Note
===========
Please use this repository instead of ppa:fkrull/deadsnakes.
Reporting Issues
================
Issues can be reported in the master issue tracker at:
https://github.com/deadsnakes/issues/issues
Supported Ubuntu and Python Versions
====================================
- Ubuntu 18.04 (bionic) Python2.3 - Python 2.6, Python 3.1 - Python 3.5, Python3.7 - Python3.11
- Ubuntu 20.04 (focal) Python3.5 - Python3.7, Python3.9 - Python3.11
- Note: Python2.7 (all), Python 3.6 (bionic), Python 3.8 (focal) are not provided by deadsnakes as upstream ubuntu provides those packages.
- Note: for focal, older python versions require libssl1.0.x so they are not currently built
The packages may also work on other versions of Ubuntu or Debian, but that is not tested or supported.
Packages
========
The packages provided here are loosely based on the debian upstream packages with some modifications to make them more usable as non-default pythons and on ubuntu. As such, the packages follow debian's patterns and often do not include a full python distribution with just `apt install python#.#`. Here is a list of packages that may be useful along with the default install:
- `python#.#-dev`: includes development headers for building C extensions
- `python#.#-venv`: provides the standard library `venv` module
- `python#.#-distutils`: provides the standard library `distutils` module
- `python#.#-lib2to3`: provides the `2to3-#.#` utility as well as the standard library `lib2to3` module
- `python#.#-gdbm`: provides the standard library `dbm.gnu` module
- `python#.#-tk`: provides the standard library `tkinter` module
可以看到输出告诉了我们系统支持的python版本,最后一个区间是python3.7到python3.11,我官网看的明明最新是3.10.4,所以我们装的是python3.10