I encountered this error when I tried to run my project. Line of code producing this error is:
from DomainServices.models.movie import Movie
But I have Movle class in my model folder and movie.py file. I also have an __init__.py
containing:
__author__ = 'ehsan'
As I've read here: Python error "ImportError: No module named" I'm sure the problem is not about init.py contents, because I replaced this file with a working one from another project. Whole error is:
[root@h149-3-137-195 DomainServices]$ python DomainServices/cron/imdb_crawler.py
Traceback (most recent call last):
File "DomainServices/cron/imdb_crawler.py", line 6, in <module>
from DomainServices.models.movie import Movie
ImportError: No module named DomainServices.models.movie
This is my project structure:
In the project directory when I run 'python' and run that import command, there is no problem! What should I do?