Answer the question
In order to leave comments, you need to log in
Trouble with importing modules in Python?
Hello, I've run into this problem. There is a directory package/__init__.py, package2.py where package is a folder. Outside this folder, there is also a package1.py file containing the following code:
import package.package2.summa
print(summa(1,2))
from package.package2 import summa
Answer the question
In order to leave comments, you need to log in
There is no problem here. You should study the module import mechanism in more detail.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question