Recently, while trying to import a module that I wrote, I came across errors that supposedly should not occur. Here is the idea that I write in my main.py file, and my hierarchy is as follows:
starsearch/ main.py parser/ __init__.py parse.py
the __ init __.py in parser / is empty, but when I try in my program:
import parser
returns an AttributeError . This happens when I call a function inside parse.py called getstar() . or
from parser import parse
returns an ImportError .
So my Python does not recognize that parse.py exists? I did a bit of work, and the __ init __.py , which is empty, should do the trick, but I'm at a dead end.
source share