'ModuleNotFoundError when trying to host my flask app

I got this error when I tried to run the docker container for my flask app.

File "./app.py", line 1, in from topology import ( ModuleNotFoundError: No module named 'topology'

Here is the import in app.py: from topology import * And my app.py file and topology file are in the same directory. I am new to this and have no idea why this import would become a problem. It looks find in PyCharm but once I run the container in the command line it becomes an issue.

I also tried to create another directory with init file and marked it as source root, and then put topology.py in but it still did not work. Anyone has experienced the same issue before?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source