如何在 macOS 上安装 PIP ?

PIP 是任何 Python 开发人员必备的工具,因为它简化了安装和管理 Python 包的过程。本教程是为 macOS 用户量身定制的,并假设对使用终端有基本的了解。

必备条件

在安装 PIP 之前,必须确保您的系统上已经安装了 Python。Python 3.4 及更高版本默认包含 PIP。您可以通过终端输入 python --version 或者 python3 --version 来快速检查 Python 版本。如果没有安装 Python,请按照下面的步骤将其与 PIP 一起安装。

Step 1: Installing Python

如果你的 macOS 上还没有安装 Python,你可以从 Python 官方网站或使用 macOS 的软件包管理器 Homebrew 轻松地安装它。为了使用 Homebrew 进行无缝安装,首先打开终端,然后执行以下命令安装 Homebrew 包管理器。

复制代码
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

安装 Homebrew 后,输入 brew install python 安装 Python,此方法在安装 Python 的同时安装 PIP。

Step 2: Verifying PIP Installation

安装 Python 后,应该默认安装 PIP。要验证这一点,请输入以下命令:

复制代码
pip --version

或者

复制代码
pip3 --version

Step 3: Updating PIP

要更新 PIP,只需运行以下命令

复制代码
pip install --upgrade pip

或者

复制代码
pip3 install --upgrade pip

Step 4: Using PIP

安装软件包

复制代码
pip install package_name

卸载软件包

复制代码
pip uninstall package_name

搜索软件包

复制代码
pip search package_name

我的开源项目

相关推荐
寒水馨4 小时前
macOS下载、安装PowerShell-v7.6.4(附安装包powershell-7.6.4-osx-arm64.pkg)
macos·自动化·跨平台·shell·脚本·命令行·powershell
星辰即远方1 天前
天气预报总结
macos·ios·objective-c·cocoa
xixiaoyunya1 天前
Mac远程访问新范式:基于80KM穿云箭的内网穿透技术实践
macos
秋雨梧桐叶落莳1 天前
计算器仿写总结
学习·macos·ios·objective-c·cocoa
软糖姐姐1 天前
Python开篇——简介、pip和conda
python·conda·pip·数据科学·
寒水馨1 天前
macOS下载、安装uv-0.12.0(附安装包uv-aarch64-apple-darwin.tar.gz)
python·macos·rust·项目管理·包管理器·astral·pip替代
寒水馨1 天前
macOS下载、安装protobuf-v35.1(附安装包protoc-35.1-osx-universal_binary.zip)
macos·google·grpc·序列化·protobuf·protoc·数据交换
寒水馨1 天前
macOS下载、安装ripgrep-15.2.0(附安装包ripgrep-15.2.0-aarch64-apple-darwin.tar.gz)
macos·正则表达式·rust·ripgrep·rg·命令行搜索·代码搜索
起司喵喵2 天前
Flutter-MacOS桌面OS系统|flutter.+window_manager客户端OS模板
flutter·macos·策略模式
代码对我眨眼睛2 天前
macOS Google Chrome 常用快捷键
前端·chrome·macos