[Python] Cannot find reference 'xxx' in __init__.py

Discussão em 'Python' iniciado por Stack, Julho 20, 2025.

  1. Stack

    Stack Membro Participativo

    I have a project in PyCharm organized as follows:

    -- Sources
    |--__init__.py
    |--Calculators
    |--__init__.py
    |--Filters.py
    |--Controllers
    |--__init__.py
    |--FiltersController.py
    |--Viewers
    |--__init__.py
    |--DataVisualization.py
    |--Models
    |--__init__.py
    |--Data


    All of my __init__.py, except for the one right above Sources are blank files. I am receiving a lot of warnings of the kind:


    Cannot find reference 'xxx' in __init__.py
    ​

    For example, my FiltersController.py has this piece of code:

    import numpy.random as npr

    bootstrap = npr.choice(image_base.data[max(0, x-2):x+3, max(0, y-2):y+3].flatten(), size=(3, 3), replace=True)


    And I get this warning:


    Cannot find reference 'choice' in __init__.py
    ​

    I'm googling wondering what does this mean and what should I do to code properly in Python.

    Continue reading...

Compartilhe esta Página