joywins25 / QnA

Temporary only for QnA
0 stars 0 forks source link

ImportError: attempted relative import with no known parent package #1

Open joywins25 opened 2 months ago

joywins25 commented 2 months ago

PS C:\Joywins\TechArchive\QnA> uvicorn main:app --reload INFO: Will watch for changes in these directories: ['C:\Joywins\TechArchive\QnA'] INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit) INFO: Started reloader process [21772] using StatReload Process SpawnProcess-1: Traceback (most recent call last): File "C:\Users\joywi\anaconda3\envs\py31064_fastselenistreamlit\lib\multiprocessing\process.py", line 314, in _bootstrap self.run() File "C:\Users\joywi\anaconda3\envs\py31064_fastselenistreamlit\lib\multiprocessing\process.py", line 108, in run self._target(*self._args, **self._kwargs) File "C:\Users\joywi\anaconda3\envs\py31064_fastselenistreamlit\lib\site-packages\uvicorn_subprocess.py", line 80, in subprocess_started target(sockets=sockets) File "C:\Users\joywi\anaconda3\envs\py31064_fastselenistreamlit\lib\site-packages\uvicorn\server.py", line 65, in run return asyncio.run(self.serve(sockets=sockets)) File "C:\Users\joywi\anaconda3\envs\py31064_fastselenistreamlit\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Users\joywi\anaconda3\envs\py31064_fastselenistreamlit\lib\asyncio\base_events.py", line 649, in run_until_complete return future.result() File "C:\Users\joywi\anaconda3\envs\py31064_fastselenistreamlit\lib\site-packages\uvicorn\server.py", line 69, in serve await self._serve(sockets) File "C:\Users\joywi\anaconda3\envs\py31064_fastselenistreamlit\lib\site-packages\uvicorn\server.py", line 76, in _serve config.load() File "C:\Users\joywi\anaconda3\envs\py31064_fastselenistreamlit\lib\site-packages\uvicorn\config.py", line 434, in load self.loaded_app = import_from_string(self.app) File "C:\Users\joywi\anaconda3\envs\py31064_fastselenistreamlit\lib\site-packages\uvicorn\importer.py", line 19, in import_from_string module = importlib.import_module(module_str) File "C:\Users\joywi\anaconda3\envs\py31064_fastselenistreamlit\lib\importlib__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "C:\Joywins\TechArchive\QnA\main.py", line 15, in from . import models, schemas ImportError: attempted relative import with no known parent package

joywins25 commented 2 months ago

PS C:\Joywins\TechArchive\QnA> uvicorn main:app --reload INFO: Will watch for changes in these directories: ['C:\Joywins\TechArchive\QnA'] INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit) INFO: Started reloader process [28656] using StatReload Process SpawnProcess-1: Traceback (most recent call last): File "C:\Users\joywi\anaconda3\envs\py31064_fastselenistreamlit\lib\multiprocessing\process.py", line 314, in _bootstrap self.run() File "C:\Users\joywi\anaconda3\envs\py31064_fastselenistreamlit\lib\multiprocessing\process.py", line 108, in run self._target(*self._args, **self._kwargs) File "C:\Users\joywi\anaconda3\envs\py31064_fastselenistreamlit\lib\site-packages\uvicorn_subprocess.py", line 80, in subprocess_started target(sockets=sockets) File "C:\Users\joywi\anaconda3\envs\py31064_fastselenistreamlit\lib\site-packages\uvicorn\server.py", line 65, in run return asyncio.run(self.serve(sockets=sockets)) File "C:\Users\joywi\anaconda3\envs\py31064_fastselenistreamlit\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Users\joywi\anaconda3\envs\py31064_fastselenistreamlit\lib\asyncio\base_events.py", line 649, in run_until_complete return future.result() File "C:\Users\joywi\anaconda3\envs\py31064_fastselenistreamlit\lib\site-packages\uvicorn\server.py", line 69, in serve await self._serve(sockets) File "C:\Users\joywi\anaconda3\envs\py31064_fastselenistreamlit\lib\site-packages\uvicorn\server.py", line 76, in _serve config.load() File "C:\Users\joywi\anaconda3\envs\py31064_fastselenistreamlit\lib\site-packages\uvicorn\config.py", line 434, in load self.loaded_app = import_from_string(self.app) File "C:\Users\joywi\anaconda3\envs\py31064_fastselenistreamlit\lib\site-packages\uvicorn\importer.py", line 19, in import_from_string module = importlib.import_module(module_str) File "C:\Users\joywi\anaconda3\envs\py31064_fastselenistreamlit\lib\importlib__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "", line 883, in exec_module File "", line 241, in _call_with_frames_removed File "C:\Joywins\TechArchive\QnA\main.py", line 18, in from . import models, schemas ImportError: attempted relative import with no known parent package