Date
Sep. 8th, 2024
 
2024年 8月 6日

Post: PIP Primer

PIP Primer

Published 12:04 Apr 22, 2013.

Created by @ezra. Categorized in #Programming, and tagged as #Python.

Source format: Markdown

Table of Content

本文主要介绍 PIP 的基本用法。

安装

方法一

sudo easy_install pip

方法二

移步 https://pypi.python.org/pypi/pip 下载安装。

方法三

移步 https://pip.pypa.io/en/stable/installing/ 下载 get-pip.py 文件。

这个文件也可以通过 curl -O https://bootstrap.pypa.io/get-pip.py 获取。

然后在本地目录执行:

sudo python get-pip.py

你可以添加 --no-setuptools 选项禁止安装 setuptools;

或者添加 --no-wheel 选项禁止安装 wheel

更新PIP

# Linux、OS X:
sudo pip install -U pip

# Windows:
sudo python -m pip install -U pip

搜索包

pip search "包"

安装包

sudo pip install 包

更新包

sudo pip install --upgrade 包
# 或
sudo pip install --upgrade 包==版本

查看已安装的包

查看某个包:

pip show --files 包

或者查看所有:

pip list

卸载包

sudo pip uninstall 包

查看有更新的包

pip list --outdated
Pinned Message
HOTODOGO
The Founder and CEO of Infeca Technology.
Developer, Designer, Blogger.
Big fan of Apple, Love of colour.
Feel free to contact me.
反曲点科技创始人和首席执行官。
程序猿、设计师、奇怪的博主。
苹果死忠、热爱色彩斑斓的世界。
如有意向请随时 与我联系