Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to extract dependencies from a PyPi package

Tags:

my goal is simple, i want to get the dependency of a PyPi package remotely without needing to download it completely.

I seem to understand (reading the pip code) that pip when resolving dependencies seems to read the egg once the package has been downloaded...

Is there any other way ?

like image 841
Olivier Girardot Avatar asked Jan 04 '13 09:01

Olivier Girardot


People also ask

How do I find the dependencies of a python package?

Pip Check Command – Check Python Dependencies After Installation. Because pip doesn't currently address dependency issues on installation, the pip check command option can be used to verify that dependencies have been installed properly in your project. For example: $ pip check No broken requirements found.

How do I get dependency of pip package?

The dependencies of the installed Python packages can be listed using the built-in pip show command. Alternatively the dependencies can be shown as a tree structure using the pipdeptree command.


1 Answers

Use pipdeptree to view dependencies of installed PyPI packages.

Install:

pip install pipdeptree 

Then run:

pipdeptree 

You'll see something like that:

Warning!!! Possible conflicting dependencies found: * Mako==0.9.1 -> MarkupSafe [required: >=0.9.2, installed: 0.18]   Jinja2==2.7.2 -> MarkupSafe [installed: 0.18] ------------------------------------------------------------------------ Lookupy==0.1 wsgiref==0.1.2 argparse==1.2.1 psycopg2==2.5.2 Flask-Script==0.6.6   - Flask [installed: 0.10.1]     - Werkzeug [required: >=0.7, installed: 0.9.4]     - Jinja2 [required: >=2.4, installed: 2.7.2]       - MarkupSafe [installed: 0.18]     - itsdangerous [required: >=0.21, installed: 0.23] alembic==0.6.2   - SQLAlchemy [required: >=0.7.3, installed: 0.9.1]   - Mako [installed: 0.9.1]     - MarkupSafe [required: >=0.9.2, installed: 0.18] ipython==2.0.0 slugify==0.0.1 redis==2.9.1 
like image 140
Rockallite Avatar answered Sep 24 '22 14:09

Rockallite