run backend error
poetry run uvicorn main:app --reload --port 7001
INFO: Will watch for changes in these directories: ['/Users/zhuhongji/Documents/workspace/screenshot-to-code/backend']
INFO: Uvicorn running on http://127.0.0.1:7001 (Press CTRL+C to quit)
INFO: Started reloader process [12100] using StatReload
Process SpawnProcess-1:
Traceback (most recent call last):
File "/usr/local/Cellar/[email protected]/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/usr/local/Cellar/[email protected]/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/zhuhongji/Library/Caches/pypoetry/virtualenvs/backend-fXnATXJ6-py3.12/lib/python3.12/site-packages/uvicorn/_subprocess.py", line 76, in subprocess_started
target(sockets=sockets)
File "/Users/zhuhongji/Library/Caches/pypoetry/virtualenvs/backend-fXnATXJ6-py3.12/lib/python3.12/site-packages/uvicorn/server.py", line 61, in run
return asyncio.run(self.serve(sockets=sockets))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/[email protected]/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/[email protected]/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/[email protected]/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/Users/zhuhongji/Library/Caches/pypoetry/virtualenvs/backend-fXnATXJ6-py3.12/lib/python3.12/site-packages/uvicorn/server.py", line 68, in serve
config.load()
File "/Users/zhuhongji/Library/Caches/pypoetry/virtualenvs/backend-fXnATXJ6-py3.12/lib/python3.12/site-packages/uvicorn/config.py", line 467, in load
self.loaded_app = import_from_string(self.app)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/zhuhongji/Library/Caches/pypoetry/virtualenvs/backend-fXnATXJ6-py3.12/lib/python3.12/site-packages/uvicorn/importer.py", line 21, in import_from_string
module = importlib.import_module(module_str)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/[email protected]/3.12.4/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/init.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "
I also encountered the same issue.
Try downgrading your Python to python:3.12.3 or lower. The new version of Pydantic has some issues with the later Python versions.
Let me know if that works.
using python 3.11 having same problem
您好~我是亚林,已收到您的邮件,会尽快回复~
Any update on this? Im on 3.9 and still see the same issue
您好~我是亚林,已收到您的邮件,会尽快回复~