I have two python modules, one named testingDirectories.py and another named testFile.py
There are two folders in my directory: simulations and src
"simulations" is supposed to hold all the source code for individual simulations that are being run.
"src" holds the source code for the main project that I run the simulations on.
My testingDirectories.py file is in "simulations", while testFile.py is in "src".
The contents of testFile.py are as follows:
def testFunction(m):
return 'hello, world'
The contents of testingDirectories.py are as follows:
import sys
import os
from src.testFile import testFunction
testFunction('hello')
When I run the simple demo, it gives me an error:
from src.testFile import testFunction
ImportError: cannot import name testFunction
The point of this demonstration is to figure out if the program can find the directory "src" without telling it to look in the root directory. It seems to be able to find other folders and their modules and functions, but not a simple test function like this one. Any ideas why I might be getting this error?