screenshot-to-code icon indicating copy to clipboard operation
screenshot-to-code copied to clipboard

Poetry run error

Open SmartWebCodder opened this issue 1 year ago • 1 comments

(backend-py3.11) PS C:\Users\HP 1030 G2\Desktop\scrrn\backend> poetry run uvicorn main:app --reload --port 7001 INFO: Will watch for changes in these directories: ['C:\Users\HP 1030 G2\Desktop\scrrn\backend'] INFO: Uvicorn running on http://127.0.0.1:7001 (Press CTRL+C to quit) INFO: Started reloader process [1872] using StatReload Process SpawnProcess-1: Traceback (most recent call last): File "C:\Python311\Lib\multiprocessing\process.py", line 314, in _bootstrap self.run() File "C:\Python311\Lib\multiprocessing\process.py", line 108, in run self._target(*self._args, **self._kwargs) File "C:\Users\HP 1030 G2\AppData\Local\pypoetry\Cache\virtualenvs\backend-fKIMLrWx-py3.11\Lib\site-packages\uvicorn_subprocess.py", line 76, in subprocess_started target(sockets=sockets) File "C:\Users\HP 1030 G2\AppData\Local\pypoetry\Cache\virtualenvs\backend-fKIMLrWx-py3.11\Lib\site-packages\uvicorn\server.py", line 61, in run return asyncio.run(self.serve(sockets=sockets)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\asyncio\runners.py", line 190, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\asyncio\runners.py", line 118, in run return self.loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "C:\Users\HP 1030 G2\AppData\Local\pypoetry\Cache\virtualenvs\backend-fKIMLrWx-py3.11\Lib\site-packages\uvicorn\server.py", line 68, in serve config.load() File "C:\Users\HP 1030 G2\AppData\Local\pypoetry\Cache\virtualenvs\backend-fKIMLrWx-py3.11\Lib\site-packages\uvicorn\config.py", line 467, in load self.loaded_app = import_from_string(self.app) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\HP 1030 G2\AppData\Local\pypoetry\Cache\virtualenvs\backend-fKIMLrWx-py3.11\Lib\site-packages\uvicorn\importer.py", line 21, in import_from_string module = importlib.import_module(module_str) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Python311\Lib\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 "C:\Users\HP 1030 G2\Desktop\scrrn\backend\main.py", line 4, in load_dotenv() File "C:\Users\HP 1030 G2\AppData\Local\pypoetry\Cache\virtualenvs\backend-fKIMLrWx-py3.11\Lib\site-packages\dotenv\main.py", line 346, in load_dotenv return dotenv.set_as_environment_variables() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\HP 1030 G2\AppData\Local\pypoetry\Cache\virtualenvs\backend-fKIMLrWx-py3.11\Lib\site-packages\dotenv\main.py", line 91, in set_as_environment_variables if not self.dict(): ^^^^^^^^^^^ File "C:\Users\HP 1030 G2\AppData\Local\pypoetry\Cache\virtualenvs\backend-fKIMLrWx-py3.11\Lib\site-packages\dotenv\main.py", line 75, in dict self._dict = OrderedDict(resolve_variables(raw_values, override=self.override)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\HP 1030 G2\AppData\Local\pypoetry\Cache\virtualenvs\backend-fKIMLrWx-py3.11\Lib\site-packages\dotenv\main.py", line 233, in resolve_variables for (name, value) in values: File "C:\Users\HP 1030 G2\AppData\Local\pypoetry\Cache\virtualenvs\backend-fKIMLrWx-py3.11\Lib\site-packages\dotenv\main.py", line 83, in parse for mapping in with_warn_for_invalid_lines(parse_stream(stream)): File "C:\Users\HP 1030 G2\AppData\Local\pypoetry\Cache\virtualenvs\backend-fKIMLrWx-py3.11\Lib\site-packages\dotenv\main.py", line 25, in with_warn_for_invalid_lines for mapping in mappings: File "C:\Users\HP 1030 G2\AppData\Local\pypoetry\Cache\virtualenvs\backend-fKIMLrWx-py3.11\Lib\site-packages\dotenv\parser.py", line 173, in parse_stream reader = Reader(stream) ^^^^^^^^^^^^^^ File "C:\Users\HP 1030 G2\AppData\Local\pypoetry\Cache\virtualenvs\backend-fKIMLrWx-py3.11\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 INFO: Stopping reloader process [1872] (backend-py3.11) PS C:\Users\HP 1030 G2\Desktop\scrrn\backend>

SmartWebCodder avatar Dec 01 '23 22:12 SmartWebCodder

Same error here, still couldnt find a solution

luucaslfs avatar Dec 15 '23 20:12 luucaslfs

See https://github.com/abi/screenshot-to-code?tab=readme-ov-file#%EF%B8%8F-faqs "Seeing UTF-8 errors when running the backend?"

abi avatar May 21 '24 17:05 abi