惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

W
WeLiveSecurity
The GitHub Blog
The GitHub Blog
Engineering at Meta
Engineering at Meta
Microsoft Azure Blog
Microsoft Azure Blog
The Register - Security
The Register - Security
Stack Overflow Blog
Stack Overflow Blog
博客园 - 三生石上(FineUI控件)
T
Threat Research - Cisco Blogs
S
SegmentFault 最新的问题
V2EX - 技术
V2EX - 技术
Hacker News: Ask HN
Hacker News: Ask HN
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
P
Proofpoint News Feed
J
Java Code Geeks
Microsoft Security Blog
Microsoft Security Blog
M
MIT News - Artificial intelligence
AI
AI
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
Hacker News - Newest:
Hacker News - Newest: "LLM"
B
Blog
N
News and Events Feed by Topic
N
News | PayPal Newsroom
Google DeepMind News
Google DeepMind News
酷 壳 – CoolShell
酷 壳 – CoolShell
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
WordPress大学
WordPress大学
C
Cybersecurity and Infrastructure Security Agency CISA
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 【当耐特】
U
Unit 42
腾讯CDC
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The Cloudflare Blog
H
Help Net Security
Recent Announcements
Recent Announcements
P
Privacy & Cybersecurity Law Blog
IT之家
IT之家
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Security Archives - TechRepublic
Security Archives - TechRepublic
L
LINUX DO - 热门话题
Martin Fowler
Martin Fowler
MongoDB | Blog
MongoDB | Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
H
Heimdal Security Blog
博客园 - 聂微东
S
Securelist
大猫的无限游戏
大猫的无限游戏
Cloudbric
Cloudbric
Cisco Talos Blog
Cisco Talos Blog

博客园 - 番茄的梦想

Debian防火墙的ufw的使用 Linux—nvm教程 LNMP一键安装包安装的mysql远程连接不上的问题 linux service文件格式 linux if命令 微软sdk及运行时下载地址 解决python错误 UnicodeDecodeError: 'gb2312' codec can't decode byte 0x8b in position 1: illegal multibyt 结构(位置)伪类选择器 如何清除mstsc记录 ubuntu开启远程桌面功能 使用Windows远程桌面工具来远程连接控制Ubuntu系统 缓存头Cache-Control的含义和使用 正则表达式 以A开头B结尾 取中间的内容 nginx 不带www的域名跳转www域名 IIS配置导入导出 CSS中hover选择器的使用详解 html 锚点三种实现方法 重置自增长id 如何解决Visual Studio2012 与此版本的Windows不兼容
pip相关介绍
番茄的梦想 · 2023-08-19 · via 博客园 - 番茄的梦想

#pip的基础使用
介绍
众所周知,pip可以对python的第三方库进行安装、更新、卸载等操作,十分方便。

pip的全称:package installer for python,也就是Python包管理工具。

Python有成千上万的宝藏库,这些库相当于是已经集成好的工具,只要安装就能在Python里使用。它们可以处理各式各样的问题,无需你再造轮子,而且随着社区的不断更新维护,有些库越来越强大,几乎能媲美企业级应用。

怎么下载安装呢?它们被放在一个统一的“仓库”里,名叫PyPi(Python Package Index),所有的库安装都是从这里调度。

有了仓库之后,还需要有管理员,pip就是这样一个角色。pip把库从PyPi取出来,然后安装到Python里,还可以管理安装好的库,比如更新、查看、搜索、卸载等等。

从Python 3.4开始,pip已经内置在Python中,所以无需再次安装。

如果你的Python版本没有pip,那可以使用下面两种方法安装。

(1) 命令行中输入easy_install pip,非常快捷

(2) 在下面网址中下载pip安装文件,然后解压到python scripts目录中,执行python setup.py install安装即可

下载网址:
https://pypi.org/project/pip/#files
下载文件:

2、查看pip版本

pip --version
1
3、升级pip
如果pip的版本太低,可以升级当前版本

pip install --upgrade pip
1
4、获取帮助
想了解如何使用pip,以及pip有哪些功能,执行下面语句可以获取详细教程:

pip help
1
5、安装库
使用pip安装第三方库,执行下面语句

pip install package_name
1
指定package版本:

pip install package_name==1.1.2
1
比如说,我要安装3.4.1版本的matplotlib

pip install matplotlib==3.4.1
1
6、批量安装库
如果一个项目需要安装很多库,那可以批量安装:

pip install -r e:\\requirements.txt
1

常用命令
如果pip的版本太低,可以升级当前版本

pip install --upgrade pip
1
普通安装

pip install requests
1
指定版本安装

pip install robotframework==2.8.7
1
卸载已安装的库

pip uninstall requests
1
列出已经安装的库
列出所有已安装的第三方库和对应版本