python - Import error, No module named xxxx -
i have project having structure
/example ../prediction ....__init__.py ....a.py
pythonpath pointed /example
now open python in terminal , type
import prediction
it succeeded, if type
import prediction.a
it returns error
importerror: no module named 'prediction.a'; 'prediction' not package
why that? isn't imported package
the behavior seeing can caused if there module (foo.py
) or package (foo/__init__.py
) in current directory has conflicting name.
in case, suspect there file named prediction.py
, , you're getting instead of prediction
package in examples
directory.
Comments
Post a Comment