Python Django ModeulNotFoundError: No module named 'SomeFolder'


I have a django app. It is quite complicated, I can’t post all the code here, so I have a big picture summary. The setup of the folders in the big picture related to what I’m doing is below. Note that "SomeFolder" is a placeholder name for the actual name. Some folder is a folder containing some python scripts with functions inside of them. It wasn’t installed in the Django app. I dragged and dropped SomeFolder into the backend folder. This is necessary and had to be done. It’s some python stuff unrelated to Django.


Inside of at the top, I do

import SomeFolder

Then, inside of, I have a function that calls some of the functions within the python scripts,, and This is why I need to import SomeFolder. For example:

def someFunction():

The issue is, when I run python runserver I get a ModuleNotFoundError: No module named 'SomeFolder' in
The SomeFolder folder is in the same directory as, so I’m not sure why it’s not being recognized. I’ve seen other similar examples on stackoverflow, but didn’t really understand them or how to fix it so I’m posting my own one here.

>Solution :

Try => from . import SomeFolder

Leave a ReplyCancel reply