Recently, in attempting to import a module I'd written, I have been coming across errors that ostensibly should not happen. Here is the idea, I'm writing in my main.py file, and my hierarchy looks like this:
starsearch/
main.py
parser/
__init__.py
parse.py
the __ init __.py file in parser/ is empty, but when I try, in my program, to:
import parser
it returns an AttributeError. This happens when I call the function inside of parse.py, called getstar().
or
from parser import parse
it returns an ImportError.
So my Python doesn't recognize that parse.py exists? I have done a bit of research, and having an __ init __.py file that's empty should do the trick, but I'm stumped.
AttributeErroris because modules in a package aren't attributes of the package -- you have to import them yourself.