How to access a module inside of a module from a file inside the first module in python?

24 views Asked by At

I have the following file format and I am getting a ModuleNotFoundError: No module named 'uploader'

Video-Generator/
    main.py
    AutoUploader/
        __init__.py
        upload.py
        uploader/
            __init__.py
            myfile.py

Essentialy, I am trying to access uploader from upload.py that is being called from main.py. That is when I get that error which originates from upload.py unable to find the module.

In main.py, I have the following to access the AutoUploader module:

from AutoUploader import *
from AutoUploader.upload import upload_video_from_json

And in upload.py, I have the following to access the uploader module:

from uploader import myfile

Thanks in advance to all your help!

0

There are 0 answers