Hướng dẫn install multiple python versions ubuntu - cài đặt nhiều phiên bản python ubuntu

Hướng dẫn install multiple python versions ubuntu - cài đặt nhiều phiên bản python ubuntu

Có một số khác biệt tinh tế trong việc quản lý các phiên bản Python trên các phân phối cũ của Ubuntu. Nếu bạn đang chạy Ubuntu 18.04 trở lên, hãy đến đây.


Một trong những thất vọng đầu tiên của tôi với sự phát triển của Python không liên quan gì đến chính Python mà là hành động bí truyền không cần thiết là triển khai một ứng dụng Python. Code Boot Camps và hướng dẫn thực hiện tốt công việc dạy học sinh cách chạy mã trăn cục bộ, nhưng các ứng dụng có ý nghĩa nhất không chạy trên máy địa phương: chúng chạy trên máy chủ, trên internet, vì đó là vấn đề, không phải là nó ? Có lẽ tôi đang uống thuốc điên ở đây.

Ubuntu 20.04 là phiên bản LTS đầu tiên của Ubuntu để thả Python2, mới ra khỏi hộp với Python 3.8.5. Nhưng điều gì sẽ xảy ra nếu bạn đã viết các ứng dụng dành cho một phiên bản Python mới hơn thì sao? Nếu bạn giống tôi, bạn có thể đã cố gắng thay thế cài đặt mặc định của hệ thống và phá hủy máy của bạn trong quá trình. Nếu không ai cảnh báo bạn, tôi sẽ làm vinh dự: Đừng làm điều đó.Python 3.8.5. But what if you've written apps intended for a newer version of Python? If you're like me, you might have tried to replace your system's default installation and destroyed your machine in the process. If nobody has warned you, I'll do the honors: don't do that.

Nguy cơ hủy diệt ngoài ý muốn chỉ là một trong nhiều chi tiết không trực quan làm phức tạp nhiệm vụ có vẻ đơn giản là sử dụng phiên bản cập nhật của Python:

  • 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
    - Ubuntu 22.04 (jammy) Python3.7 - Python3.9, Python3.11
    - Note: Python2.7 (all), Python 3.6 (bionic), Python 3.8 (focal), Python 3.10 (jammy) are not provided by deadsnakes as upstream ubuntu provides those packages.
    
    Why some packages aren't built:
    - Note: for focal, older python versions require libssl<1.1 so they are not currently built
    - Note: for jammy, older python versions requre libssl<3 so they are not currently built
    - If you need these, reach out to asottile to set up a private ppa
    
    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
    
    Third-Party Python Modules
    ==========================
    
    Python modules in the official Ubuntu repositories are packaged to work with the Python interpreters from the official repositories. Accordingly, they generally won't work with the Python interpreters from this PPA. As an exception, pure-Python modules for Python 3 will work, but any compiled extension modules won't.
    
    To install 3rd-party Python modules, you should use the common Python packaging tools.  For an introduction into the Python packaging ecosystem and its tools, refer to the Python Packaging User Guide:
    https://packaging.python.org/installing/
    
    Sources
    =======
    The package sources are available at:
    https://github.com/deadsnakes/
    
    Nightly Builds
    ==============
    
    For nightly builds, see ppa:deadsnakes/nightly https://launchpad.net/~deadsnakes/+archive/ubuntu/nightly
     More info: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
    Press [ENTER] to continue or Ctrl-c to cancel adding it.
    4 không áp dụng cho các phiên bản của Python. Trong thực tế...
  • Các bản phân phối Python mới hơn thậm chí không thể nhìn thấy đối với
    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
    - Ubuntu 22.04 (jammy) Python3.7 - Python3.9, Python3.11
    - Note: Python2.7 (all), Python 3.6 (bionic), Python 3.8 (focal), Python 3.10 (jammy) are not provided by deadsnakes as upstream ubuntu provides those packages.
    
    Why some packages aren't built:
    - Note: for focal, older python versions require libssl<1.1 so they are not currently built
    - Note: for jammy, older python versions requre libssl<3 so they are not currently built
    - If you need these, reach out to asottile to set up a private ppa
    
    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
    
    Third-Party Python Modules
    ==========================
    
    Python modules in the official Ubuntu repositories are packaged to work with the Python interpreters from the official repositories. Accordingly, they generally won't work with the Python interpreters from this PPA. As an exception, pure-Python modules for Python 3 will work, but any compiled extension modules won't.
    
    To install 3rd-party Python modules, you should use the common Python packaging tools.  For an introduction into the Python packaging ecosystem and its tools, refer to the Python Packaging User Guide:
    https://packaging.python.org/installing/
    
    Sources
    =======
    The package sources are available at:
    https://github.com/deadsnakes/
    
    Nightly Builds
    ==============
    
    For nightly builds, see ppa:deadsnakes/nightly https://launchpad.net/~deadsnakes/+archive/ubuntu/nightly
     More info: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
    Press [ENTER] to continue or Ctrl-c to cancel adding it.
    5; Do đó, chúng tôi thậm chí không thể sử dụng
    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
    - Ubuntu 22.04 (jammy) Python3.7 - Python3.9, Python3.11
    - Note: Python2.7 (all), Python 3.6 (bionic), Python 3.8 (focal), Python 3.10 (jammy) are not provided by deadsnakes as upstream ubuntu provides those packages.
    
    Why some packages aren't built:
    - Note: for focal, older python versions require libssl<1.1 so they are not currently built
    - Note: for jammy, older python versions requre libssl<3 so they are not currently built
    - If you need these, reach out to asottile to set up a private ppa
    
    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
    
    Third-Party Python Modules
    ==========================
    
    Python modules in the official Ubuntu repositories are packaged to work with the Python interpreters from the official repositories. Accordingly, they generally won't work with the Python interpreters from this PPA. As an exception, pure-Python modules for Python 3 will work, but any compiled extension modules won't.
    
    To install 3rd-party Python modules, you should use the common Python packaging tools.  For an introduction into the Python packaging ecosystem and its tools, refer to the Python Packaging User Guide:
    https://packaging.python.org/installing/
    
    Sources
    =======
    The package sources are available at:
    https://github.com/deadsnakes/
    
    Nightly Builds
    ==============
    
    For nightly builds, see ppa:deadsnakes/nightly https://launchpad.net/~deadsnakes/+archive/ubuntu/nightly
     More info: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
    Press [ENTER] to continue or Ctrl-c to cancel adding it.
    6 để tìm một phiên bản Python gần đây hơn mà không có sự giúp đỡ của bên thứ ba.
  • Các phiên bản của Python được cài đặt trên cùng một máy không chia sẻ cùng các tính năng cốt lõi (như PIP), dẫn đến rất nhiều sự nhầm lẫn.pip), which leads to a lot of confusion.

Chúng ta làm gì?

Sử dụng

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
- Ubuntu 22.04 (jammy) Python3.7 - Python3.9, Python3.11
- Note: Python2.7 (all), Python 3.6 (bionic), Python 3.8 (focal), Python 3.10 (jammy) are not provided by deadsnakes as upstream ubuntu provides those packages.

Why some packages aren't built:
- Note: for focal, older python versions require libssl<1.1 so they are not currently built
- Note: for jammy, older python versions requre libssl<3 so they are not currently built
- If you need these, reach out to asottile to set up a private ppa

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

Third-Party Python Modules
==========================

Python modules in the official Ubuntu repositories are packaged to work with the Python interpreters from the official repositories. Accordingly, they generally won't work with the Python interpreters from this PPA. As an exception, pure-Python modules for Python 3 will work, but any compiled extension modules won't.

To install 3rd-party Python modules, you should use the common Python packaging tools.  For an introduction into the Python packaging ecosystem and its tools, refer to the Python Packaging User Guide:
https://packaging.python.org/installing/

Sources
=======
The package sources are available at:
https://github.com/deadsnakes/

Nightly Builds
==============

For nightly builds, see ppa:deadsnakes/nightly https://launchpad.net/~deadsnakes/+archive/ubuntu/nightly
 More info: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
Press [ENTER] to continue or Ctrl-c to cancel adding it.
7 tích hợp của Ubuntu là tối ưu vì nhiều lý do:

  1. Chúng tôi có thể cài đặt một phiên bản mới của Python song song với phiên bản Python Ubuntu phụ thuộc vào, vì vậy chúng tôi không làm hỏng máy của chúng tôi.
  2. Tốt nhất là tránh làm rối xung quanh với con đường Python của bạn bất cứ khi nào có thể.
  3. Chúng tôi có thể dễ dàng chuyển đổi phiên bản hoạt động của Python trên máy của chúng tôi thông qua CLI thuận tiện.

Chúng tôi sẽ đi qua cách cài đặt phiên bản Python mới nhất cùng với các phiên bản Python hệ thống của Ubuntu một cách an toàn và (tương đối) một cách dễ dàng.

Python qua chết

Deadnakes PPA là một kho lưu trữ Python được duy trì tích cực có sẵn cho Ubuntu. Deadnakes mang gánh nặng của các phiên bản lưu trữ của Python đã được thử và thử nghiệm để làm việc trên Ubuntu, (tổ chức GitHub của họ về cơ bản là một bộ sưu tập các phiên bản Python thân thiện với Ubuntu).Deadsnakes carries the burden of hosting versions of Python that have been tried and tested to work on Ubuntu, (their Github organization is essentially a collection of Ubuntu-friendly Python versions).

Bằng cách thêm PPA chết, chúng tôi sẽ hiển thị các phiên bản Python này cho các máy Ubuntu của chúng tôi:

$ sudo add-apt-repository ppa:deadsnakes/ppa
Add Kho lưu trữ Deadnakesdeadsnakes repository

Khi thêm kho lưu trữ này, bạn sẽ ngay lập tức nhận được lời nhắc giải thích điều này bằng các thuật ngữ dài dòng. Nhấn Enter để di chuyển.enter to move on.

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
- Ubuntu 22.04 (jammy) Python3.7 - Python3.9, Python3.11
- Note: Python2.7 (all), Python 3.6 (bionic), Python 3.8 (focal), Python 3.10 (jammy) are not provided by deadsnakes as upstream ubuntu provides those packages.

Why some packages aren't built:
- Note: for focal, older python versions require libssl<1.1 so they are not currently built
- Note: for jammy, older python versions requre libssl<3 so they are not currently built
- If you need these, reach out to asottile to set up a private ppa

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

Third-Party Python Modules
==========================

Python modules in the official Ubuntu repositories are packaged to work with the Python interpreters from the official repositories. Accordingly, they generally won't work with the Python interpreters from this PPA. As an exception, pure-Python modules for Python 3 will work, but any compiled extension modules won't.

To install 3rd-party Python modules, you should use the common Python packaging tools.  For an introduction into the Python packaging ecosystem and its tools, refer to the Python Packaging User Guide:
https://packaging.python.org/installing/

Sources
=======
The package sources are available at:
https://github.com/deadsnakes/

Nightly Builds
==============

For nightly builds, see ppa:deadsnakes/nightly https://launchpad.net/~deadsnakes/+archive/ubuntu/nightly
 More info: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
Press [ENTER] to continue or Ctrl-c to cancel adding it.
DeadsNakes nhắc nhở việc sử dụngDeadsnakes prompt explaining usage

Để chọn các phiên bản của Python mà Deadnakes hiển thị cho chúng tôi, chúng tôi vẫn cần chạy một bản cập nhật nhanh:

$ sudo apt update
Update Gói có thể nhìn thấy đối với Ubuntu

Bây giờ hãy kiểm tra xem phiên bản Python bạn đang tìm kiếm có sẵn để tải xuống như vậy không:

$ apt list | grep python3.x
Keeck cho phiên bản Python mong muốn của bạn

Nếu có sẵn, bạn sẽ thấy một đầu ra như vậy:

A

Đó là ánh sáng xanh của chúng tôi! Tiếp tục và tiến hành cài đặt Python:

$ sudo apt install python3.9
install Python3.xPython3.x

Quản lý cài đặt Python thay thế

Bây giờ chúng tôi có hai phiên bản Python được cài đặt trên máy của chúng tôi: Hệ thống mặc định Python 3.8.5 và Python 3.9.2 mới được thêm vào của chúng tôi. Chúng tôi muốn chỉ để cài đặt Python mặc định hệ thống của chúng tôi một mình, nhưng chúng tôi muốn chạy các ứng dụng của chúng tôi được viết bằng Python 3.9 ... Vậy làm thế nào để chúng tôi quản lý điều này?Python 3.8.5, and our newly added Python 3.9.2. We want to leave our system default Python installation alone, but we want to run our apps written in Python 3.9... so how do we manage this?

Linux có chúng tôi được đề cập trong kịch bản này với lệnh Cập nhật-Diễn hóa. Chúng tôi có thể nói với Ubuntu rằng chúng tôi có nhiều phiên bản thay thế của cùng một phần mềm trên máy của chúng tôi, do đó cho chúng tôi khả năng chuyển đổi giữa chúng một cách dễ dàng. Đây là cách nó hoạt động:

$ update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
$ update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 2
Set Phiên bản thay thế cho Python

Chúng tôi đã chạy

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
- Ubuntu 22.04 (jammy) Python3.7 - Python3.9, Python3.11
- Note: Python2.7 (all), Python 3.6 (bionic), Python 3.8 (focal), Python 3.10 (jammy) are not provided by deadsnakes as upstream ubuntu provides those packages.

Why some packages aren't built:
- Note: for focal, older python versions require libssl<1.1 so they are not currently built
- Note: for jammy, older python versions requre libssl<3 so they are not currently built
- If you need these, reach out to asottile to set up a private ppa

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

Third-Party Python Modules
==========================

Python modules in the official Ubuntu repositories are packaged to work with the Python interpreters from the official repositories. Accordingly, they generally won't work with the Python interpreters from this PPA. As an exception, pure-Python modules for Python 3 will work, but any compiled extension modules won't.

To install 3rd-party Python modules, you should use the common Python packaging tools.  For an introduction into the Python packaging ecosystem and its tools, refer to the Python Packaging User Guide:
https://packaging.python.org/installing/

Sources
=======
The package sources are available at:
https://github.com/deadsnakes/

Nightly Builds
==============

For nightly builds, see ppa:deadsnakes/nightly https://launchpad.net/~deadsnakes/+archive/ubuntu/nightly
 More info: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
Press [ENTER] to continue or Ctrl-c to cancel adding it.
8 hai lần: một lần cho Python 3.8 và một lần cho Python 3.9. Vì vậy, bây giờ chúng tôi có thể sử dụng
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
- Ubuntu 22.04 (jammy) Python3.7 - Python3.9, Python3.11
- Note: Python2.7 (all), Python 3.6 (bionic), Python 3.8 (focal), Python 3.10 (jammy) are not provided by deadsnakes as upstream ubuntu provides those packages.

Why some packages aren't built:
- Note: for focal, older python versions require libssl<1.1 so they are not currently built
- Note: for jammy, older python versions requre libssl<3 so they are not currently built
- If you need these, reach out to asottile to set up a private ppa

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

Third-Party Python Modules
==========================

Python modules in the official Ubuntu repositories are packaged to work with the Python interpreters from the official repositories. Accordingly, they generally won't work with the Python interpreters from this PPA. As an exception, pure-Python modules for Python 3 will work, but any compiled extension modules won't.

To install 3rd-party Python modules, you should use the common Python packaging tools.  For an introduction into the Python packaging ecosystem and its tools, refer to the Python Packaging User Guide:
https://packaging.python.org/installing/

Sources
=======
The package sources are available at:
https://github.com/deadsnakes/

Nightly Builds
==============

For nightly builds, see ppa:deadsnakes/nightly https://launchpad.net/~deadsnakes/+archive/ubuntu/nightly
 More info: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
Press [ENTER] to continue or Ctrl-c to cancel adding it.
9 để liệt kê tất cả các cài đặt thay thế mà chúng tôi đã cài đặt:

$ update-alternatives --list python3
/usr/bin/python3.8
/usr/bin/python3.9
Các phiên bản đã cài đặt của Python

Bây giờ chúng ta có thể trao đổi giữa các phiên bản của Python! Chạy như sau:

$ update-alternatives --config python3
Swaps giữa các phiên bản

Bạn nên bị đánh với một lời nhắc như cái dưới đây. Điều này sẽ liệt kê tất cả các phiên bản của Python mà hệ thống của bạn nhận ra. Chọn phiên bản Python bạn muốn sử dụng bằng cách cung cấp số "lựa chọn" cho dấu nhắc:

There are 2 choices for the alternative python3 (providing /usr/bin/python3).

  Selection    Path                      Priority   Status
------------------------------------------------------------
  0            /usr/bin/python3.9   2         auto mode
* 1            /usr/bin/python3.8   1         manual mode
  2            /usr/bin/python3.9   2         manual mode

Press  to keep the current choice[*], or type selection number:
Cli để chuyển đổi phiên bản Python hoạt động

Để chuyển các phiên bản Python, tất cả những gì bạn cần là trả lời lời nhắc trên với số lựa chọn đại diện cho phiên bản Python bạn muốn sử dụng.

Chúng tôi đã thực hiện phần "khó khăn", nhưng có một chút vệ sinh để chăm sóc.

Hoàn thiện chạm

Phiên bản của Python mà chúng tôi vừa kích hoạt là một bản cài đặt hoàn toàn mới, có nghĩa là có một vài phần quan trọng mà chúng tôi vẫn cần thiết lập. Vì bất cứ lý do gì, Python không giao hàng với Trình quản lý gói (PIP) của mình. Nó cũng không vận chuyển với Distutils (cần thiết để cài đặt các mô -đun Python cũ hơn) hoặc VENV, Trình quản lý môi trường ảo của Python. Hãy chăm sóc nó.pip) included. Nor does it ship with distutils (necessary for installing older Python modules) or venv, Python's virtual environment manager. Let's take care of it.

Đầu tiên, chúng ta sẽ cần cài đặt lại Python3-Act với phiên bản Python Active mới của chúng ta:python3-apt with our new version of Python active:

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
- Ubuntu 22.04 (jammy) Python3.7 - Python3.9, Python3.11
- Note: Python2.7 (all), Python 3.6 (bionic), Python 3.8 (focal), Python 3.10 (jammy) are not provided by deadsnakes as upstream ubuntu provides those packages.

Why some packages aren't built:
- Note: for focal, older python versions require libssl<1.1 so they are not currently built
- Note: for jammy, older python versions requre libssl<3 so they are not currently built
- If you need these, reach out to asottile to set up a private ppa

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

Third-Party Python Modules
==========================

Python modules in the official Ubuntu repositories are packaged to work with the Python interpreters from the official repositories. Accordingly, they generally won't work with the Python interpreters from this PPA. As an exception, pure-Python modules for Python 3 will work, but any compiled extension modules won't.

To install 3rd-party Python modules, you should use the common Python packaging tools.  For an introduction into the Python packaging ecosystem and its tools, refer to the Python Packaging User Guide:
https://packaging.python.org/installing/

Sources
=======
The package sources are available at:
https://github.com/deadsnakes/

Nightly Builds
==============

For nightly builds, see ppa:deadsnakes/nightly https://launchpad.net/~deadsnakes/+archive/ubuntu/nightly
 More info: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
Press [ENTER] to continue or Ctrl-c to cancel adding it.
0Reinstall Python3-Act cho cài đặt Python thay thế của bạnpython3-apt for your alternative Python installation

Tiếp theo, chúng tôi sẽ thêm Distutils:distutils:

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
- Ubuntu 22.04 (jammy) Python3.7 - Python3.9, Python3.11
- Note: Python2.7 (all), Python 3.6 (bionic), Python 3.8 (focal), Python 3.10 (jammy) are not provided by deadsnakes as upstream ubuntu provides those packages.

Why some packages aren't built:
- Note: for focal, older python versions require libssl<1.1 so they are not currently built
- Note: for jammy, older python versions requre libssl<3 so they are not currently built
- If you need these, reach out to asottile to set up a private ppa

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

Third-Party Python Modules
==========================

Python modules in the official Ubuntu repositories are packaged to work with the Python interpreters from the official repositories. Accordingly, they generally won't work with the Python interpreters from this PPA. As an exception, pure-Python modules for Python 3 will work, but any compiled extension modules won't.

To install 3rd-party Python modules, you should use the common Python packaging tools.  For an introduction into the Python packaging ecosystem and its tools, refer to the Python Packaging User Guide:
https://packaging.python.org/installing/

Sources
=======
The package sources are available at:
https://github.com/deadsnakes/

Nightly Builds
==============

For nightly builds, see ppa:deadsnakes/nightly https://launchpad.net/~deadsnakes/+archive/ubuntu/nightly
 More info: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
Press [ENTER] to continue or Ctrl-c to cancel adding it.
1Stall Distutilsdistutils

Và tất nhiên, PIP:pip:

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
- Ubuntu 22.04 (jammy) Python3.7 - Python3.9, Python3.11
- Note: Python2.7 (all), Python 3.6 (bionic), Python 3.8 (focal), Python 3.10 (jammy) are not provided by deadsnakes as upstream ubuntu provides those packages.

Why some packages aren't built:
- Note: for focal, older python versions require libssl<1.1 so they are not currently built
- Note: for jammy, older python versions requre libssl<3 so they are not currently built
- If you need these, reach out to asottile to set up a private ppa

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

Third-Party Python Modules
==========================

Python modules in the official Ubuntu repositories are packaged to work with the Python interpreters from the official repositories. Accordingly, they generally won't work with the Python interpreters from this PPA. As an exception, pure-Python modules for Python 3 will work, but any compiled extension modules won't.

To install 3rd-party Python modules, you should use the common Python packaging tools.  For an introduction into the Python packaging ecosystem and its tools, refer to the Python Packaging User Guide:
https://packaging.python.org/installing/

Sources
=======
The package sources are available at:
https://github.com/deadsnakes/

Nightly Builds
==============

For nightly builds, see ppa:deadsnakes/nightly https://launchpad.net/~deadsnakes/+archive/ubuntu/nightly
 More info: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
Press [ENTER] to continue or Ctrl-c to cancel adding it.
2install pippip

Cuối cùng, VENV cũng sẽ cần được cài đặt lại:venv will need to be reinstalled as well:

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
- Ubuntu 22.04 (jammy) Python3.7 - Python3.9, Python3.11
- Note: Python2.7 (all), Python 3.6 (bionic), Python 3.8 (focal), Python 3.10 (jammy) are not provided by deadsnakes as upstream ubuntu provides those packages.

Why some packages aren't built:
- Note: for focal, older python versions require libssl<1.1 so they are not currently built
- Note: for jammy, older python versions requre libssl<3 so they are not currently built
- If you need these, reach out to asottile to set up a private ppa

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

Third-Party Python Modules
==========================

Python modules in the official Ubuntu repositories are packaged to work with the Python interpreters from the official repositories. Accordingly, they generally won't work with the Python interpreters from this PPA. As an exception, pure-Python modules for Python 3 will work, but any compiled extension modules won't.

To install 3rd-party Python modules, you should use the common Python packaging tools.  For an introduction into the Python packaging ecosystem and its tools, refer to the Python Packaging User Guide:
https://packaging.python.org/installing/

Sources
=======
The package sources are available at:
https://github.com/deadsnakes/

Nightly Builds
==============

For nightly builds, see ppa:deadsnakes/nightly https://launchpad.net/~deadsnakes/+archive/ubuntu/nightly
 More info: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
Press [ENTER] to continue or Ctrl-c to cancel adding it.
3install Venvvenv

Bạn làm được rồi

Nghe có vẻ vô lý, việc cập nhật thành công Python trên Ubuntu là một thành tựu hợp pháp. Tôi đã chứng kiến ​​các nhà phát triển phần mềm của tất cả các nền tảng đấu tranh với những điều ngu ngốc như "thiết lập Python". Một số nhiệm vụ là không trực quan và thiếu bất kỳ mẫu hoặc logic thông thường. Cập nhật Python trên Ubuntu là một trong những nhiệm vụ đó.

Bạn đã xoay sở để thắng thế, vì vậy xin chúc mừng theo thứ tự. Nếu bạn chưa quen với Python, xin đừng nản lòng vì điều này phức tạp kỳ lạ như thế nào. Hành trình khốn khổ mà chúng tôi vừa bắt tay là không có dấu hiệu phát triển phần mềm như thế nào ... hoặc bất kỳ nghề nào liên quan, cho vấn đề đó. Từ đây trở đi, trời nắng, cầu vồng và rắn.

Tôi có thể cài đặt nhiều phiên bản Python trong ubuntu không?

Dễ dàng cài đặt và quản lý nhiều phiên bản Python trên Ubuntu 20.04 hoặc mới hơn. Có một số khác biệt tinh tế trong việc quản lý các phiên bản Python trên các phân phối cũ của Ubuntu. Nếu bạn đang chạy Ubuntu 18.04 trở lên, hãy đến đây.. There are a number of subtle differences in managing versions of Python on older distributions of Ubuntu. If you're running Ubuntu 18.04 or older, go here.

Tôi có thể cài đặt nhiều phiên bản của Python Linux không?

Nó có thể cài đặt nhiều phiên bản Python, chỉ định phiên bản sử dụng toàn hệ thống và chỉ định phiên bản được sử dụng trong các thư mục cụ thể.Nó cũng có thể tạo và quản lý môi trường ảo bằng các phiên bản cụ thể., specify the version that's used system-wide, and specify the version that's used in specific directories. It can also create and manage virtual environments using specific versions.

Làm cách nào để nhận được nhiều phiên bản của Python?

Cài đặt phiên bản phát triển mới nhất của Python.Chuyển đổi giữa các phiên bản đã cài đặt.Sử dụng môi trường ảo với pyenv.Kích hoạt các phiên bản Python và môi trường ảo khác nhau tự động ...
install..
versions..
which..
global..
local..
shell..

Làm cách nào để cài đặt hai phiên bản Python?

Mở dấu nhắc lệnh và nhập PIP Cài đặt VirtualEnv ..
Tải xuống phiên bản Python mong muốn (không thêm vào đường dẫn!) Và hãy nhớ đường dẫn \ to \ new_python.exe của phiên bản mới được cài đặt ..
Để tạo một ảo ảnh VirtualEnv, hãy mở dấu nhắc lệnh và nhập ..