Closed 1ozturkbe closed 7 years ago
it looks like you were in the gpfit folder? Shouldn't you import gpfit.fit
?
poop. I need a lesson in libraries and importing instead. But why did it give the error above? I'm still confused about that; shouldn't it have failed outright?
Not if you were in the gpfit folder, or any folder with a file called fit.py
I am stupid... so please explain to me why I need to say import gpfit.fit
instead of just import fit
within the folder. Because I understand using from fit import fit
, but wouldn't import fit
just suffice?
in Python 2, import <filename in current directory>
will import that file directly, not as part of its package, so you get the non-package
error. Better to just never work directly in the gpfit repository unless you're actually editing gpfit code...
K. Note taken, and lesson in imports learned. Thanks Ned, closing!
https://www.python.org/dev/peps/pep-0328/#guido-s-decision and http://stackoverflow.com/a/11537218 have some details!
I am on commit 648d114, and was about to try to fit something very basic when I got the following error from trying import fit.
??? Help?