yuval9313 / FastApi-RESTful

Quicker way to develop FastApi
MIT License
180 stars 25 forks source link

[BUG] ModuleNotFoundError: No module named 'typing_inspect' #294

Open a1d4r opened 6 months ago

a1d4r commented 6 months ago

Describe the bug

Cannot import cbv due to missing dependency

  File "...py", line 4, in <module>
    from fastapi_restful.cbv import cbv
  File "/Users/aidar/.pyenv/versions/3.12.3/envs/.../lib/python3.12/site-packages/fastapi_restful/__init__.py", line 4, in <module>
    from .cbv_base import Api, Resource, set_responses, take_init_parameters
  File "/Users/aidar/.pyenv/versions/3.12.3/envs/.../lib/python3.12/site-packages/fastapi_restful/cbv_base.py", line 5, in <module>
    from .cbv import INCLUDE_INIT_PARAMS_KEY, RETURN_TYPES_FUNC_KEY, _cbv
  File "/Users/aidar/.pyenv/versions/3.12.3/envs/.../lib/python3.12/site-packages/fastapi_restful/cbv.py", line 21, in <module>
    from typing_inspect import is_classvar
ModuleNotFoundError: No module named 'typing_inspect'

To Reproduce Steps to reproduce the behavior:

  1. Import cbv: from fastapi_restful.cbv import cbv

Expected behavior No error ocurred

Screenshots If applicable, add screenshots to help explain your problem.

Environment:

Additional context typing_inspect marked as optional package. However, it is required when using pydantic v2.