1

I have a issue with Pycharm, that shows an error on importing local modules, even though it works.

enter image description here

The working code for import is

from response_generator import core

Pycharm suggests

from .response_generator import core

When executing what pycharm suggest. Error received is:

ModuleNotFoundError: No module named '__main__.response_generator'; '__main__' is not a package

Anyone got a fix on this?

shad0w_wa1k3r
  • 12,219
  • 8
  • 64
  • 88
Christian Moen
  • 1,193
  • 1
  • 16
  • 30
  • Possible duplicate of [PyCharm shows unresolved references error for valid code](https://stackoverflow.com/questions/11725519/pycharm-shows-unresolved-references-error-for-valid-code) – Chamath Feb 13 '18 at 11:55
  • `from .response_generator import core` you include in your `__init__.py`. Then you can use `from response_generator import core` in your code. – Jānis Š. Feb 13 '18 at 11:59

0 Answers0