Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'create_response_field' from 'fastapi.utils' (/usr/local/lib/python3.11/site-packages/fastapi/utils.py) #187

Open
mayishidai opened this issue Sep 10, 2024 · 3 comments

Comments

@mayishidai
Copy link

bash-5.2# faa run
Traceback (most recent call last):
File "/usr/local/bin/uvicorn", line 8, in
sys.exit(main())
^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 410, in main
run(
File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 577, in run
server.run()
File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 65, in run
return asyncio.run(self.serve(sockets=sockets))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/asyncio/base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 69, in serve
await self._serve(sockets)
File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 76, in _serve
config.load()
File "/usr/local/lib/python3.11/site-packages/uvicorn/config.py", line 434, in load
self.loaded_app = import_from_string(self.app)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/uvicorn/importer.py", line 19, in import_from_string
module = importlib.import_module(module_str)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1204, in _gcd_import
File "", line 1176, in _find_and_load
File "", line 1147, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/data/workspace/my_fastapi/backend/main.py", line 5, in
from core.globals import site
File "/data/workspace/my_fastapi/backend/core/init.py", line 3, in
from core.settings import settings
File "/data/workspace/my_fastapi/backend/core/settings.py", line 6, in
from fastapi_amis_admin.admin.settings import Settings as AmisSettings
File "/usr/local/lib/python3.11/site-packages/fastapi_amis_admin/admin/init.py", line 1, in
from .admin import (
File "/usr/local/lib/python3.11/site-packages/fastapi_amis_admin/admin/admin.py", line 35, in
from fastapi_amis_admin.admin.handlers import register_exception_handlers
File "/usr/local/lib/python3.11/site-packages/fastapi_amis_admin/admin/handlers.py", line 19, in
from fastapi_amis_admin.crud import BaseApiOut
File "/usr/local/lib/python3.11/site-packages/fastapi_amis_admin/crud/init.py", line 3, in
from ._sqlalchemy import SqlalchemyCrud, SqlalchemySelector
File "/usr/local/lib/python3.11/site-packages/fastapi_amis_admin/crud/_sqlalchemy.py", line 53, in
from .parser import (
File "/usr/local/lib/python3.11/site-packages/fastapi_amis_admin/crud/parser.py", line 6, in
from fastapi.utils import create_cloned_field, create_response_field
ImportError: cannot import name 'create_response_field' from 'fastapi.utils' (/usr/local/lib/python3.11/site-packages/fastapi/utils.py)

@MALossov
Copy link

fastapi/fastapi#12103
作者更新了 现在不叫这个了

@MALossov
Copy link

@amisadmin 请求更新 或者我来pr

@goodeXpLot
Copy link

fastapi作者更新了create_response_field 名称现在叫create_model_field
#188

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants