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

Error while generating #450

Open
JuanjoRC8 opened this issue Dec 4, 2024 · 6 comments
Open

Error while generating #450

JuanjoRC8 opened this issue Dec 4, 2024 · 6 comments

Comments

@JuanjoRC8
Copy link

JuanjoRC8 commented Dec 4, 2024

When generating from any image got error.
error

Got this in the console log:
image
And this in the backend:
image
image

Also the log in text:
Traceback (most recent call last):
File "C:\Python312\Lib\multiprocessing\process.py", line 314, in _bootstrap
self.run()
File "C:\Python312\Lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\uvicorn_subprocess.py", line 76, in subprocess_started
target(sockets=sockets)
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\uvicorn\server.py", line 61, in run
return asyncio.run(self.serve(sockets=sockets))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\asyncio\runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\asyncio\runners.py", line 118, in run
return self.loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\asyncio\base_events.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\uvicorn\server.py", line 68, in serve
config.load()
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\uvicorn\config.py", line 467, in load
self.loaded_app = import_from_string(self.app)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\uvicorn\importer.py", line 21, in import_from_string
module = importlib.import_module(module_str)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\importlib_init
.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in find_and_load_unlocked
File "", line 935, in load_unlocked
File "", line 995, in exec_module
File "", line 488, in call_with_frames_removed
File "C:\Users\Juanjo\Documents\Github\screenshot-to-code\backend\main.py", line 7, in
from fastapi import FastAPI
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\fastapi_init
.py", line 7, in
from .applications import FastAPI as FastAPI
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\fastapi\applications.py", line 16, in
from fastapi import routing
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\fastapi\routing.py", line 24, in
from fastapi.dependencies.models import Dependant
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\fastapi\dependencies\models.py", line 3, in
from fastapi.security.base import SecurityBase
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\fastapi\security_init
.py", line 1, in
from .api_key import APIKeyCookie as APIKeyCookie
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\fastapi\security\api_key.py", line 3, in
from fastapi.openapi.models import APIKey, APIKeyIn
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\fastapi\openapi\models.py", line 103, in
class Schema(BaseModel):
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\pydantic\main.py", line 286, in new
config.load()
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\uvicorn\config.py", line 467, in load
self.loaded_app = import_from_string(self.app)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\uvicorn\importer.py", line 21, in import_from_string
module = importlib.import_module(module_str)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\importlib_init.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in gcd_import
File "", line 1360, in find_and_load
File "", line 1331, in find_and_load_unlocked
File "", line 935, in load_unlocked
File "", line 995, in exec_module
File "", line 488, in call_with_frames_removed
File "C:\Users\Juanjo\Documents\Github\screenshot-to-code\backend\main.py", line 7, in
from fastapi import FastAPI
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\fastapi_init
.py", line 7, in
from .applications import FastAPI as FastAPI
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\fastapi\applications.py", line 16, in
from fastapi import routing
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\fastapi\routing.py", line 24, in
from fastapi.dependencies.models import Dependant
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\fastapi\dependencies\models.py", line 3, in
from fastapi.security.base import SecurityBase
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\fastapi\security_init
.py", line 1, in
from .api_key import APIKeyCookie as APIKeyCookie
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\fastapi\security\api_key.py", line 3, in
from fastapi.openapi.models import APIKey, APIKeyIn
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\fastapi\openapi\models.py", line 103, in
class Schema(BaseModel):
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\pydantic\main.py", line 286, in new
cls.try_update_forward_refs()
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\pydantic\main.py", line 807, in try_update_forward_refs
update_model_forward_refs(cls, cls.fields.values(), cls.config.json_encoders, localns, (NameError,))
cls.try_update_forward_refs()
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\pydantic\main.py", line 807, in try_update_forward_refs
cls.try_update_forward_refs()
cls.try_update_forward_refs()
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\pydantic\main.py", line 807, in try_update_forward_refs
cls.try_update_forward_refs()
cls.try_update_forward_refs()
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\pydantic\main.py", line 807, in try_update_forward_refs
cls.try_update_forward_refs()
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\pydantic\main.py", line 807, in try_update_forward_refs
update_model_forward_refs(cls, cls.fields.values(), cls.config.json_encoders, localns, (NameError,))
cls.try_update_forward_refs()
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\pydantic\main.py", line 807, in try_update_forward_refs
cls.try_update_forward_refs()
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\pydantic\main.py", line 807, in try_update_forward_refs
cls.try_update_forward_refs()
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\pydantic\main.py", line 807, in try_update_forward_refs
cls.try_update_forward_refs()
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\pydantic\main.py", line 807, in try_update_forward_refs
cls.try_update_forward_refs()
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\pydantic\main.py", line 807, in try_update_forward_refs
cls.try_update_forward_refs()
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\pydantic\main.py", line 807, in try_update_forward_refs
update_model_forward_refs(cls, cls.fields.values(), cls.config.json_encoders, localns, (NameError,))
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\pydantic\typing.py", line 554, in update_model_forward_refs
cls.try_update_forward_refs()
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\pydantic\main.py", line 807, in try_update_forward_refs
update_model_forward_refs(cls, cls.fields.values(), cls.config.json_encoders, localns, (NameError,))
cls.try_update_forward_refs()
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\pydantic\main.py", line 807, in try_update_forward_refs
cls.try_update_forward_refs()
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\pydantic\main.py", line 807, in try_update_forward_refs
cls.try_update_forward_refs()
cls.try_update_forward_refs()
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\pydantic\main.py", line 807, in try_update_forward_refs
update_model_forward_refs(cls, cls.fields.values(), cls.config.json_encoders, localns, (NameError,))
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\pydantic\typing.py", line 554, in update_model_forward_refs
update_field_forward_refs(f, globalns=globalns, localns=localns)
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\pydantic\typing.py", line 520, in update_field_forward_refs
field.type = evaluate_forwardref(field.type, globalns, localns or None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\pydantic\typing.py", line 66, in evaluate_forwardref
return cast(Any, type)._evaluate(globalns, localns, set())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard'

@abi
Copy link
Owner

abi commented Dec 4, 2024

Try #386 (comment)

@SimpleDioney
Copy link

PS C:\Users\dione\Downloads\screenshot-to-code-main\screenshot-to-code-main\backend> python --version
Python 3.12.3
PS C:\Users\dione\Downloads\screenshot-to-code-main\screenshot-to-code-main\backend> poetry run uvicorn main:app --reload --port 7001
INFO: Will watch for changes in these directories: ['C:\Users\dione\Downloads\screenshot-to-code-main\screenshot-to-code-main\backend']
INFO: Uvicorn running on http://127.0.0.1:7001 (Press CTRL+C to quit)
INFO: Started reloader process [31888] using StatReload
Process SpawnProcess-1:
Traceback (most recent call last):
File "C:\Python312\Lib\multiprocessing\process.py", line 314, in _bootstrap
self.run()
File "C:\Python312\Lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\uvicorn_subprocess.py", line 76, in subprocess_started
target(sockets=sockets)
File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\uvicorn\server.py", line 61, in run
return asyncio.run(self.serve(sockets=sockets))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\asyncio\runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\asyncio\runners.py", line 118, in run
return self.loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\asyncio\base_events.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\uvicorn\server.py", line 68, in serve
config.load()
File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\uvicorn\config.py", line 467, in load
self.loaded_app = import_from_string(self.app)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\uvicorn\importer.py", line 21, in import_from_string
module = importlib.import_module(module_str)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\importlib_init
.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "", line 995, in exec_module
File "", line 488, in _call_with_frames_removed
File "C:\Users\dione\Downloads\screenshot-to-code-main\screenshot-to-code-main\backend\main.py", line 4, in
load_dotenv()
File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\dotenv\main.py", line 356, in load_dotenv
return dotenv.set_as_environment_variables()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\dotenv\main.py", line 92, in set_as_environment_variables
if not self.dict():
^^^^^^^^^^^
File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\dotenv\main.py", line 76, in dict
self._dict = OrderedDict(resolve_variables(raw_values, override=self.override))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\dotenv\main.py", line 238, in resolve_variables
for (name, value) in values:
^^^^^^
File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\dotenv\main.py", line 84, in parse
for mapping in with_warn_for_invalid_lines(parse_stream(stream)):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\dotenv\main.py", line 26, in with_warn_for_invalid_lines
for mapping in mappings:
^^^^^^^^
File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\dotenv\parser.py", line 173, in parse_stream
reader = Reader(stream)
^^^^^^^^^^^^^^
File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\dotenv\parser.py", line 64, in init
self.string = stream.read()
^^^^^^^^^^^^^
File "", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

@abi
Copy link
Owner

abi commented Dec 8, 2024

Please see the README for a solution to this problem.

@SimpleDioney
Copy link

I ran the step by step and it continues:

File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\fastapi\routing.py", line 24, in
(backend-py3.12) PS C:\Users\dione\Downloads\screenshot-to-code-main\screenshot-to-code-main\backend\backend> poetry run uvicorn main:app --reload --port 7000
INFO: Will watch for changes in these directories: ['C:\Users\dione\Downloads\screenshot-to-code-main\screenshot-to-code-main\backend\backend']
INFO: Uvicorn running on http://127.0.0.1:7000 (Press CTRL+C to quit)
INFO: Started reloader process [12992] using StatReload
Process SpawnProcess-1:
Traceback (most recent call last):
File "C:\Python312\Lib\multiprocessing\process.py", line 314, in _bootstrap
self.run()
File "C:\Python312\Lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\uvicorn_subprocess.py", line 76, in subprocess_started
target(sockets=sockets)
File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\uvicorn\server.py", line 61, in run
return asyncio.run(self.serve(sockets=sockets))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\asyncio\runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\asyncio\runners.py", line 118, in run
return self.loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\asyncio\base_events.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\uvicorn\server.py", line 68, in serve
config.load()
File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\uvicorn\config.py", line 467, in load
self.loaded_app = import_from_string(self.app)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\uvicorn\importer.py", line 21, in import_from_string
module = importlib.import_module(module_str)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\importlib_init
.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in gcd_import
File "", line 1360, in find_and_load
File "", line 1331, in find_and_load_unlocked
File "", line 935, in load_unlocked
File "", line 995, in exec_module
File "", line 488, in call_with_frames_removed
File "C:\Users\dione\Downloads\screenshot-to-code-main\screenshot-to-code-main\backend\backend\main.py", line 7, in
from fastapi import FastAPI
File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\fastapi_init
.py", line 7, in
from .applications import FastAPI as FastAPI
File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\fastapi\applications.py", line 16, in
from fastapi import routing
File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\fastapi\routing.py", line 24, in
from fastapi.dependencies.models import Dependant
File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\fastapi\dependencies\models.py", line 3, in
from fastapi.security.base import SecurityBase
File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\fastapi\security_init
.py", line 1, in
from .api_key import APIKeyCookie as APIKeyCookie
File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\fastapi\security\api_key.py", line 3, in
from fastapi.openapi.models import APIKey, APIKeyIn
File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\fastapi\openapi\models.py", line 103, in
class Schema(BaseModel):
File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\pydantic\main.py", line 286, in new
cls.try_update_forward_refs()
File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\pydantic\main.py", line 807, in try_update_forward_refs
update_model_forward_refs(cls, cls.fields.values(), cls.config.json_encoders, localns, (NameError,))
File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\pydantic\typing.py", line 554, in update_model_forward_refs
update_field_forward_refs(f, globalns=globalns, localns=localns)
File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\pydantic\typing.py", line 520, in update_field_forward_refs
field.type = evaluate_forwardref(field.type, globalns, localns or None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\dione\AppData\Local\pypoetry\Cache\virtualenvs\backend-ChyaHEbJ-py3.12\Lib\site-packages\pydantic\typing.py", line 66, in evaluate_forwardref
return cast(Any, type)._evaluate(globalns, localns, set())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard'

@abi
Copy link
Owner

abi commented Dec 8, 2024

This error should be fixed by #386 (comment)

@JuanjoRC8
Copy link
Author

I did downgrade with pyenv to python 3.12.2 and again got the same issue, but this time this is the log:
image
image
Here in plain text:
Process SpawnProcess-1:
Traceback (most recent call last):
File "C:\Python312\Lib\multiprocessing\process.py", line 314, in _bootstrap
self.run()
File "C:\Python312\Lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\uvicorn_subprocess.py", line 76, in subprocess_started
target(sockets=sockets)
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\uvicorn\server.py", line 61, in run
return asyncio.run(self.serve(sockets=sockets))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\asyncio\runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\asyncio\runners.py", line 118, in run
return self.loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\asyncio\base_events.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\uvicorn\server.py", line 68, in serve
config.load()
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\uvicorn\config.py", line 467, in load
self.loaded_app = import_from_string(self.app)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\uvicorn\importer.py", line 21, in import_from_string
module = importlib.import_module(module_str)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\importlib_init
.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in gcd_import
File "", line 1360, in find_and_load
File "", line 1331, in find_and_load_unlocked
File "", line 935, in load_unlocked
File "", line 995, in exec_module
File "", line 488, in call_with_frames_removed
File "C:\Users\Juanjo\Documents\Github\screenshot-to-code\backend\main.py", line 7, in
from fastapi import FastAPI
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\fastapi_init
.py", line 7, in
from .applications import FastAPI as FastAPI
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\fastapi\applications.py", line 16, in
from fastapi import routing
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\fastapi\routing.py", line 24, in
from fastapi.dependencies.models import Dependant
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\fastapi\dependencies\models.py", line 3, in
from fastapi.security.base import SecurityBase
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\fastapi\security_init
.py", line 1, in
from .api_key import APIKeyCookie as APIKeyCookie
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\fastapi\security\api_key.py", line 3, in
from fastapi.openapi.models import APIKey, APIKeyIn
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\fastapi\openapi\models.py", line 103, in
class Schema(BaseModel):
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\pydantic\main.py", line 286, in new
cls.try_update_forward_refs()
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\pydantic\main.py", line 807, in try_update_forward_refs
update_model_forward_refs(cls, cls.fields.values(), cls.config.json_encoders, localns, (NameError,))
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\pydantic\typing.py", line 554, in update_model_forward_refs
update_field_forward_refs(f, globalns=globalns, localns=localns)
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\pydantic\typing.py", line 520, in update_field_forward_refs
field.type = evaluate_forwardref(field.type, globalns, localns or None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Juanjo\AppData\Local\pypoetry\Cache\virtualenvs\backend-0aiVKvt6-py3.12\Lib\site-packages\pydantic\typing.py", line 66, in evaluate_forwardref
return cast(Any, type)._evaluate(globalns, localns, set())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard'

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