百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
P

pipdeptree

> 包管理
开源

一个命令行工具,用于显示已安装的 Python 包的依赖树。

3.0K stars0 点赞2 次浏览
访问官网GitHub

工具介绍

一个命令行工具,用于显示已安装的 Python 包的依赖树。

pipdeptree

pipdeptree 以依赖树的形式显示已安装的 Python 包。 pip freeze 显示的是扁平列表;而 pipdeptree 则增加了父子关系, 并报告依赖冲突或循环依赖。

快速开始

bash
pip install pipdeptree
pipdeptree
Flask==0.10.1
┣━━ ✓ itsdangerous required: >=0.21 installed: 0.24
┣━━ ✓ Jinja2 required: >=2.4 installed: 2.11.2
┃   ┗━━ ⚠ MarkupSafe required: >=0.23 installed: 0.22
┗━━ ✓ Werkzeug required: >=0.7 installed: 0.11.2

查找需要某个依赖的包:

bash
pipdeptree --reverse --packages markupsafe

以 JSON、Mermaid 或 Graphviz 格式输出:

bash
pipdeptree -o json
pipdeptree -o mermaid
pipdeptree -o graphviz-svg > deps.svg

报告包数量、深度、冲突、循环、许可证和大小:

bash
pipdeptree --summary           # aligned text
pipdeptree --summary -o rich   # styled table
pipdeptree --summary -o json   # machine-readable

在不安装的情况下检查依赖树。针对包索引解析需求,或离线读取已解析的 PEP 751 锁文件:

bash
pipdeptree from-index "flask"          # i is a shorthand alias
pipdeptree from-index --requirements requirements.txt
pipdeptree from-lock pylock.toml       # l is a shorthand alias

上述渲染标志(包括 --summary)对两个子命令均有效。

如需完整文档,请访问 pipdeptree.readthedocs.io。

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rustdependency-graphpippython

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类包管理
定价开源

> 相关工具

N
npm
Node.js 默认包管理器
P
pnpm
高效节省磁盘的 Node 包管理器
I
is-gif
Check if a Buffer/Uint8Array is a GIF image