Skip to content

[17.0] Circular imports when installing fastapi #565

@orfisko

Description

@orfisko

Module

fastapi

Describe the bug

When I install this module and I have fastapi already installed in the virtual environment, I get circular import errors.

ImportError: cannot import name 'APIRouter' from partially initialized module 'fastapi' (most likely due to a circular import) (odoo_addons/fastapi/__init__.py) 2025-09-23 09:59:30,831 1537745 INFO odoo_prod werkzeug: 127.0.0.1 - - [23/Sep/2025 09:59:30] "POST /web/dataset/call_button HTTP/1.1" 200 - 1570 0.423 0.980

To Reproduce

Affected versions:

Steps to reproduce the behavior:

  1. Extract the fastapi folder to the addons directory
  2. Install the module

Expected behavior
I don´t understand why the exact same name is chosen for the odoo module as the library it all originates from. This is asking for trouble.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions