[Solved]ModuleNotFoundError: No module named '__main__.pagerank_weighted'; '__main__' is not a package

Code:

from math import log10from .pagerank_weighted import pagerank_weighted_scipy as _pagerankfrom .preprocessing.textcleaner import clean_text_by_sentences as _clean_text_by_sentencesfrom .commons import build_graph as _build_graphfrom .commons import remove_unreachable_nodes as _remove_unreachable_nodes

ERROR: 

$ python summarizer.py 
Traceback (most recent call last):
  File "summarizer.py", line 3, in
    from .pagerank_weighted import pagerank_weighted_scipy as _pagerank
ModuleNotFoundError: No module named '__main__.pagerank_weighted'; '__main__' is not a package

Solution:

Simply remove the dot for the relative import and do:

From 

from .pagerank_weighted import pagerank_weighted_scipy as _pagerank 

To 

from pagerank_weighted import pagerank_weighted_scipy as _pagerank