有没有办法列出点子的依赖关系/要求? [英] Is there a way to list pip dependencies/requirements?

查看:75
本文介绍了有没有办法列出点子的依赖关系/要求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在不进行安装的情况下,我想快速查看pip install将要安装的所有软件包.

解决方案

已接受的答案不再与最新版本的pip相关,并且在不仔细评论多个内容的情况下也不会立即给出答案,因此我提供了更新的答案. /p>

这已通过 8.1.2 9.0.1 10.0.1 18.1 的pip版本进行了测试. >.

要获得输出而又不会在Linux上弄乱您的当前目录,请使用

pip download [package] -d /tmp --no-binary :all: -v

-d告诉pip目录下载文件应放在其中.

更好的方法是,仅使用此脚本,并将其参数作为包名称,以仅获取依赖项作为输出:

#!/bin/sh

PACKAGE=$1
pip download $PACKAGE -d /tmp --no-binary :all:-v 2>&1 \
| grep Collecting \
| cut -d' ' -f2 \
| grep -Ev "$PACKAGE(~|=|\!|>|<|$)"

此处也可用.

Without going through with the installation, I want to quickly see all the packages that pip install would install.

解决方案

The accepted answer is no longer relevant for more current versions of pip and does not give an immediate answer without perusing multiple comments so I am providing an updated answer.

This was tested with pip versions 8.1.2, 9.0.1, 10.0.1, and 18.1.

To get the output without cluttering your current directory on Linux use

pip download [package] -d /tmp --no-binary :all: -v

-d tells pip the directory that download should put files in.

Better, just use this script with the argument being the package name to get only the dependencies as output:

#!/bin/sh

PACKAGE=$1
pip download $PACKAGE -d /tmp --no-binary :all:-v 2>&1 \
| grep Collecting \
| cut -d' ' -f2 \
| grep -Ev "$PACKAGE(~|=|\!|>|<|$)"

Also available here.

这篇关于有没有办法列出点子的依赖关系/要求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆