简体   繁体   English

如何在 linux 上为 Python 3.10.9 安装 pip

[英]How do I install pip on linux for Python 3.10.9

I was using sudo apt-get install python3-pip to get pip with older versions of Python, but as I understand I have to install a newer version of pip using some different approach because it is not uptodate using apt.我使用sudo apt-get install python3-pip来获取 pip 和旧版本的 Python,但据我所知,我必须使用一些不同的方法安装更新版本的 pip,因为它不是最新的使用 apt。 I am using an Ubuntu pc and a Raspberry pi for reference, Many posts about this but what is the currently accepted approach as of Jan 2023?我正在使用 Ubuntu pc 和 Raspberry pi 作为参考,有很多关于此的帖子,但截至 2023 年 1 月,目前接受的方法是什么? Thanks!谢谢!

EDIT:编辑:

Using pip -V informes that it is using pip 20.3.4 (python 3.9)使用pip -V通知它正在使用 pip 20.3.4 (python 3.9)

I have Python 3.10.9 installed, and the console informs me version 22.3.1 is also installed我安装了 Python 3.10.9,控制台提示我还安装了 22.3.1 版

Requirement already satisfied: pip in /usr/local/lib/python3.10/site-packages (22.3.1)

Anyone know how to use version 22.3.1?有人知道如何使用 22.3.1 版吗?

did you tested get-pip.py ?你测试过get-pip.py吗?

simply download it from here , and run只需从这里下载,然后运行

python get-pip.py

Based on my experience with Raspberry Pi, it should be straightforward with apt install .根据我使用 Raspberry Pi 的经验,使用apt install应该很简单。

sudo apt update
sudo apt install python3-pip

Verify the version:验证版本:

pip3 --version

Odoo Forum Reference: https://www.odoo.com/forum/help-1/how-to-install-pip-in-python-3-on-ubuntu-18-04-167715 Odoo论坛参考: https://www.odoo.com/forum/help-1/how-to-install-pip-in-python-3-on-ubuntu-18-04-167715

sudo apt-get install python3-pip and then use sudo apt-get install python3-pip然后使用

python3 -m pip install --upgrade pip to upgrade pip

or you can do that.或者你可以这样做。

sudo python3.10.9 -m pip install pip

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM