#1090781 fastapi: unable to start, reports 'please install "fastapi[standard]"'

#1090781#5
Date:
2024-12-19 03:40:09 UTC
From:
To:
Using latest version of FastAPI, it refuses to start and wants to be
re-installed via pip. This does not seem right?


# dpkg -l | grep fastapi
ii  python3-fastapi                 0.115.5-2                   all
      modern, fast, web framework for building APIs, based on type
hints

# which fastapi
/usr/bin/fastapi

# fastapi version
To use the fastapi command, please install "fastapi[standard]":
pip install "fastapi[standard]"
Traceback (most recent call last):
  File "/usr/bin/fastapi", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3/dist-packages/fastapi/cli.py", line 12, in main
    raise RuntimeError(message)  # noqa: B904
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: To use the fastapi command, please install "fastapi[standard]":
pip install "fastapi[standard]"

#1090781#10
Date:
2024-12-19 05:38:31 UTC
From:
To:
This looks like a missing dependency on fastapi-cli (unpackaged)

https://github.com/fastapi/fastapi-cli

Both packages declare an entrypoint script for fastapi; the one in the
fastapi package doesn't seem useful for Debian.

regards
Stuart

#1090781#15
Date:
2025-01-19 08:13:53 UTC
From:
To:
Ah, see https://github.com/fastapi/fastapi/discussions/11525 for why
fastapi-cli was moved to a separate package, so avoid having fastapi
depend on such a large set of packages.

So as Stuart Prescott points out in
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1090781#10
it would make more sense for these dependencies to be part of a new
fastapi-cli package and to drop the /usr/bin/fastapi command from
python3-fastapi.

Best wishes,

   Julian

#1090781#20
Date:
2025-01-19 08:23:38 UTC
From:
To:
closing #1093046 as there's nothing to be done for src:fastapi, and
even if there was, no optional dependency belongs in the Depends
field, but instead in the Recommended/Suggests fields depending on
their importance in the optional features they enable when present.