mardi 10 décembre 2019

Importing Module issue (name of project and name of module are the same)

So I am having an issue trying to import some modules right now because the name of the project is same as the module name. At least thats what I think.

I am trying to run the test_aws_file.py main file. That file is trying to import my.test.utils.util_file, but it is getting this error: ModuleNotFoundError: No module named 'my.test'

test_aws_file.py import coding:

sys.path.insert(1, os.path.abspath('.')) print(sys.path) from my.test.aws.utils.utils_file import UtilsFile

project name: my.test.aws

my/

test/
   aws/
      utils/
          util_file.py

test_aws/

 test_aws_file.py

Aucun commentaire:

Enregistrer un commentaire