Relative Content

Tag Archive for pythonimportmodule

ModuleNotFoundError: No module named ‘Roles’ – attempted relative import beyond top-level package

I am trying to organize my application so other developers can build off of it. When I try to test my application I keep getting the “attempted relative import beyond top-level package” error. I started with a mvc template and everything was working until I tried to import my controller files that I made to the main app.py file. As I am typing this I found the solution and figured out I worded the import incorrectly. However Now when I try to run “Flask run” I get the error ModuleNotFound even though vs code recognizes the file.