If you can generate a relevant traceback, please include it.
(.test_env) caoyizhendeMacBook-Air➜ test ᐅ cd /Users/caoyizhen/Documents/python代码/test ; /usr/bin/env /Users/caoyizhen/Documents/python代码/te
st/.test_env/bin/python /Users/caoyizhen/.vscode/extensions/ms-python.python-2023.22.1/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher
50436 -- /Users/caoyizhen/Documents/python代码/test/test.py
Traceback (most recent call last):
File "/Users/caoyizhen/Documents/python代码/test/test.py", line 109, in
from fastapi_restful import Api, Resource
File "/Users/caoyizhen/Documents/python代码/test/.test_env/lib/python3.9/site-packages/fastapi_restful/init.py", line 1, in
from .cbv_base import Api, Resource, set_responses, take_init_parameters
File "/Users/caoyizhen/Documents/python代码/test/.test_env/lib/python3.9/site-packages/fastapi_restful/cbv_base.py", line 5, in
from .cbv import INCLUDE_INIT_PARAMS_KEY, RETURN_TYPES_FUNC_KEY, _cbv
File "/Users/caoyizhen/Documents/python代码/test/.test_env/lib/python3.9/site-packages/fastapi_restful/cbv.py", line 11, in
from typing_inspect import is_classvar
ModuleNotFoundError: No module named 'typing_inspect'
To Reproduce
Steps to reproduce the behavior:
create dir code : mkdir test
code: cd test -> python -m venv .env
source .env/bin/activate
pip install fastapi pydantic fastapi-restful
create a python file
import fastapi_restful
Expected behavior
A clear and concise description of what you expected to happen.
code can be run
Screenshots
If applicable, add screenshots to help explain your problem.
Environment:
OS: macos
FastAPI RESTful, FastAPI, and Pydantic versions [e.g. 0.3.0], get them with:
fastapi 0.108.0
fastapi-restful 0.5.0
pydantic 2.5.3
pydantic_core 2.14.6
from fastapi import FastAPI
from fastapi.requests import Request
from fastapi_restful import Api, Resource
from pydantic import BaseModel
import uvicorn
app = FastAPI()
api = Api(app)
class Model(BaseModel):
name : str
age : int
class Index(Resource):
async def post(self, request:Request):
data = await request.json()
data = Model(**data)
return data
api.add_resource(Index, "/index")
if __name__ == "__main__":
uvicorn.run(app)
Python version, get it with:
Python 3.9.6
Additional context
Add any other context about the problem here.
Describe the bug import fastapi_restfule failed
If you can generate a relevant traceback, please include it. (.test_env) caoyizhendeMacBook-Air➜ test ᐅ cd /Users/caoyizhen/Documents/python代码/test ; /usr/bin/env /Users/caoyizhen/Documents/python代码/te st/.test_env/bin/python /Users/caoyizhen/.vscode/extensions/ms-python.python-2023.22.1/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher 50436 -- /Users/caoyizhen/Documents/python代码/test/test.py Traceback (most recent call last): File "/Users/caoyizhen/Documents/python代码/test/test.py", line 109, in
from fastapi_restful import Api, Resource
File "/Users/caoyizhen/Documents/python代码/test/.test_env/lib/python3.9/site-packages/fastapi_restful/init.py", line 1, in
from .cbv_base import Api, Resource, set_responses, take_init_parameters
File "/Users/caoyizhen/Documents/python代码/test/.test_env/lib/python3.9/site-packages/fastapi_restful/cbv_base.py", line 5, in
from .cbv import INCLUDE_INIT_PARAMS_KEY, RETURN_TYPES_FUNC_KEY, _cbv
File "/Users/caoyizhen/Documents/python代码/test/.test_env/lib/python3.9/site-packages/fastapi_restful/cbv.py", line 11, in
from typing_inspect import is_classvar
ModuleNotFoundError: No module named 'typing_inspect'
To Reproduce Steps to reproduce the behavior:
Expected behavior A clear and concise description of what you expected to happen.
code can be run
Screenshots If applicable, add screenshots to help explain your problem.
Environment:
0.3.0
], get them with: fastapi 0.108.0 fastapi-restful 0.5.0 pydantic 2.5.3 pydantic_core 2.14.6Additional context Add any other context about the problem here.