pythonpipeggdistribute

How to determine the name of an egg for a Python package on Github?


I know I can install with

$ pip install -e git+https://git.repo/some_pkg#egg=SomePackage

but -- when I'm trying to use somebody else's package -- how do I determine what the name of the egg is?


Solution

  • Look at the git repo, find the setup.py, setup.cfg or pyproject.toml file in the root and find what name has been set.

    For example, the Pyramid project has a setup.py file, which has:

    setup(
      name='pyramid',
    

    so you'd use:

    $ pip install -e 'git+https://github.com/Pylons/pyramid.git#egg=pyramid'
    

    Or, if you look at the FastAPI repository, then you'd find a pyproject.toml file with:

    [tool.flit.metadata]
    module = "fastapi"
    

    and so you'd use

    $ pip install -e 'git+https://github.com/tiangolo/fastapi.git#egg=fastapi'