Linux 安装 Python 包管理工具 Pip

发布于 2024-06-22 03:24:28 字数 1828 浏览 29 评论 0

pip 是一个常用的 Python 包管理工具,主要是用于安装 PyPI 上的软件包,可以替代 easy_install 工具。

在 Centos 7 中安装 Python 包管理工具—Pip 时,使用 sudo yum install python-pip 时无法安装,是由于 Centos 发行版的源内容更新的比较滞后,导致找不到 python-pip 这个包管理工具。

这里解决的是无法安装 pip 时问题,或者说是如何在 Centos 7 中安装 Python 包管理工具 Pip 。

一、脚本安装 pip

首先下载 get-pip.py 脚本,然后运行即可安装:

$  curl -O  https://bootstrap.pypa.io/get-pip.py 

$  python get-pip.py

二、使用包管理软件安装

1、首先安装 epel 扩展源:

$ sudo yum -y install epel-release

2、然后安装 python-pip

$ sudo yum -y install python-pip

三、其他 linux 中安装 Pip

1、Debian/Ubuntu

sudo apt-get install python-pip

2、Fedora

Fedora 21:​

Python 2:​

  sudo yum upgrade python-setuptools
  sudo yum install python-pip python-wheel

Python 3:​

  sudo yum install python3 python3-wheel

Fedora 22:

Python 2:

  sudo dnf upgrade python-setuptools
  sudo dnf install python-pip python-wheel

Python 3:​

  sudo dnf install python3 python3-wheel

3、openSUSE

Python 2:
	sudo zypper install python-pip python-setuptools python-wheel
Python 3:
	sudo zypper install python3-pip python3-setuptools python3-wheel

4、Arch Linux

Python 2:
	sudo pacman -S python2-pip
Python 3:
	sudo pacman -S python-pip

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

关于作者

丑丑阿

暂无简介

文章
评论
26 人气
更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文