pythonpython-poetrypipx

Create a poetry pypi project & install it with pipx


I have a python project that I have uploaded to pypi, and now I am attempting to install it with pipx:

pipx install dup-hawk

however, I'm getting:

No apps associated with package dup-hawk. Try again with '--include-deps' to include apps of dependent packages, which are listed above. If you are
attempting to install a library, pipx should not be used. Consider using pip or a similar tool instead.

I think this is due to me not having an entry script for my project defined in poetry. How do I define an entry point in a poetry project so it can be installed with pipx?


Solution

  • You need to add a tool.poetry.scripts in your pyproject.toml line to use pipx with a cli:

    [tool.poetry.scripts]
    dup-hawk = 'dup_hawk.dup_hawk:dup_hawk_click'