-2

I have these lines in these files:

config.py:

from main import main as m

main.py:

from pycocoevalcap.cider.cider import Cider

pycocoevalcap/cider/cider.py:

from cider_scorer import CiderScorer

and in "cider_scorer.py" file, there is a class named "CiderScorer". but when I run "config.py" with CommandLine on Windows, I get this error:

ModuleNotFoundError: No module named 'cider_scorer'

I can't find what's wrong here?

this is the code: https://github.com/yicheng-w/CommonSenseMultiHopQA

A.mh
  • 122
  • 1
  • 3
  • 10
  • 1
    Presuming this is in a package you probably want `from .cider_scorer import ...`. But you do need to add details like **where** this `cider_scorer` is ... you added details about every module **except the one that can’t be found** – donkopotamus Aug 22 '20 at 09:35
  • 1
    clone this package : https://github.com/ruotianluo/cider Because I think you took it from here. And read the readme file. Be careful the module can be in a subfolder. –  Aug 22 '20 at 09:37
  • 2
    Does this answer your question? [Python - Module Not Found](https://stackoverflow.com/questions/37233140/python-module-not-found) – wovano Aug 22 '20 at 09:58
  • @donkopotamus as I said there is a cider_scorer.py. there is a class named CiderScorre in that file. you can find it here : https://github.com/yicheng-w/CommonSenseMultiHopQA/blob/master/src/pycocoevalcap/cider/cider_scorer.py – A.mh Aug 22 '20 at 13:01

1 Answers1

-1

The cause of this error is usually one of three causes:

  1. path of module is wrong
  2. module name is incorrect
  3. library module not installed (not your case) checkout: [1]: https://pytutorial.com/how-to-solve-modulenotfounderror-no-module-named-in-python [2]: Python - Module Not Found
  • Welcome to Stack Overflow and thanks to your contribution. If you know the question has been asked and answered before, please don't create a new answer that refers to the previous one, but flag the question as duplicate. Regarding your answer itself: could you explain what "path of module is wrong" means and how it can be solved? Bullet 2 and 3 do not apply, so seems not useful to mention here, IMHO. – wovano Aug 22 '20 at 09:58
  • that's the structure of the code and I checked it many times, path and name is correct. I need to add the path of that module in OS path? this is the code: https://github.com/yicheng-w/CommonSenseMultiHopQA/tree/master – A.mh Aug 22 '20 at 13:15