Cannot find reference 'xxx' in __init__.py - Python / Pycharm

后端 未结 7 838
一整个雨季
一整个雨季 2020-12-01 01:09

I have a project in Pycharm organized as follows:

-- Sources
   |--__init__.py
   |--Calculators
      |--__init__.py
      |--Filters.py
   |--Controllers
         


        
7条回答
  •  再見小時候
    2020-12-01 01:48

    Make sure you didn't by mistake changed the file type of __init__.py files. If, for example, you changed their type to "Text" (instead of "Python"), PyCharm won't analyze the file for Python code. In that case, you may notice that the file icon for __init__.py files is different from other Python files.

    To fix, in Settings > Editor > File Types, in the "Recognized File Types" list click on "Text" and in the "File name patterns" list remove __init__.py.

提交回复
热议问题