ModuleNotFoundError: No module named – Error is returning for including modules organized in the project structure [closed]

I have the following problem.
I’m making an api in fastapi, it’s working, but when importing modules within some py script, it returns as an example: “ModuleNotFoundError:
“from config.database import connection
ModuleNotFoundError: No module named ‘config'”
the file is in the right structure and in the right place, inside the folder (config > database.py).
The virtual environment is activated and everything works fine. If anyone has any tips or has already solved it. I thank!
I’m not able to import any modules from the project, the libraries work.

I tried to check the semantics, and check the paths. And apparently everything is fine.

  • Does this answer your question? import my database connection with python

    – 

Leave a Comment