i am trying to import a function from another file
a/b/c.py
a/1/2.py
i wanted to import a funciton from c.py in 2.py
sys.path.insert(1, '/path/to/c/py/a/b/c')
from c import function1, function2
i got this error:
Traceback (most recent call last):
File "path\to\2\py\a\1\2.py", line 5, in <module>
from c import function1, function2
ModuleNotFoundError: No module named 'c'
sys.path
should contain the directories (and maybe ZIP files) that contain the top-level modules or packages. Asc
is actually a module filec.py
it must not be part of asys.path
path.