rest-framework icon indicating copy to clipboard operation
rest-framework copied to clipboard

[17.0] Circular imports when installing fastapi

Open orfisko opened this issue 4 months ago • 2 comments

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.

orfisko avatar Sep 23 '25 10:09 orfisko