gpt-engineer
gpt-engineer copied to clipboard
Error loading ASGI app. Could not import module "main"
Getting the above error while launching the generated application. We are trying to execute the uvicorn main:app --reload command from the projects/[name] folder, whereas it should be uvicorn workspace.main:app --reload since main.py lies inside the projects/[name]/workspace folder.
Thanks for that extra bit of information at the top.
Instead of ~uvicorn main:app --reload. the correct command should be
uvicorn workspace.main:app --reloadThis is because main.py is located within the
workspace` flow of the file.
use this updated command:
uvicorn workspace.main:app --reload
with this module parth `workspace.main) you should now be able to use your application without that error loading ASGI.
ALSO make sure you are executing the command from the right directory. Which would be the root direc of your project. (Where you find the projects
FOLDER shortly put but that will gurantee that all module paths are resolved correctly if it DOES NOT.
If you still have any issues after that please provide the additional details and error and I will try to test and figure it out - hope this fixes this for you though!
Closing this answered issue since it has been stale for a long time.