pip as an importable module?

Paul Moore p.f.moore at gmail.com
Wed May 1 10:15:09 EDT 2019


Pip doesn't have a programming API, so no, you can't do this. Having
said that, it looks like pip-conflict-checker only uses
`pip.get_installed_distributions`, and setuptools (pkg_resources,
specifically) has an API that does this, so you could probably
relatively easily fix the code to use that.

The stuff here is probably what you want:
https://setuptools.readthedocs.io/en/latest/pkg_resources.html#getting-or-creating-distributions

Paul

On Wed, 1 May 2019 at 15:05, Skip Montanaro <skip.montanaro at gmail.com> wrote:
>
> I'm trying to get pip-conflict-checker working with Python 3.6:
>
> https://github.com/ambitioninc/pip-conflict-checker
>
> It would seem that the pip API has changed since this tool was last
> updated, as what's there appears only to be used in support of pip as
> a command line tool. Is there something comparable which is being
> maintained, or a description of how to adapt to the new
> pip-as-a-module API?
>
> Thx,
>
> Skip
> --
> https://mail.python.org/mailman/listinfo/python-list


More information about the Python-list mailing list