Module is not callable
import matplotlib.pyplot as plt
import numpy as np
x, y = np.meshgrid(np.linspace(-1, 1, 10), np.linspace(-1, 1, 10))
x, y = x.ravel(), y.ravel()
fig, ax = plt.subplots(constrained_layout=True)
ax.tripcolor(x, y, np.sin(x) + np.cos(y))
plt.show()
This shows Module is not callable at ax.tripcolor.
Version: v2022.9.11 Python: 3.10.5 OS: Linux Arch
Also: https://github.com/microsoft/python-type-stubs/issues/226
workaround. update you stub to point to the function of the same name.

I have stumbled on a similar problem. I guess it may be the same bug, so I report it here. If not, please let me know.
from kedro.pipeline import Pipeline, pipeline
def create_pipeline(**kwargs) -> Pipeline:
return pipeline([])
Pylance threw Module is not callable at the line return pipeline([]) because it confused the function pipeline with the module pipeline. However, the error disappeared when I modified my code as follows:
from kedro.pipeline import Pipeline
from kedro.pipeline.modular_pipeline import pipeline
def create_pipeline(**kwargs) -> Pipeline:
return pipeline([])
Given that « matplotlib 3.8 will ship with typing stubs » (https://github.com/matplotlib/matplotlib/issues/24701#issuecomment-1530126439), you can try the in-development version using pip install git+https://github.com/matplotlib/matplotlib.git#egg=matplotlib.
It should work as-is with pyright and mypy, but for Pylance you'll have to remove the bundled stubs everytime you update the extension. it can be found at: %HOMEPATH%\.vscode\extensions\ms-python.vscode-pylance-<VERSION>\dist\bundled\stubs\matplotlib (where <VERSION> is your current Pylance version).
If the issue persists, you can raise it upstream.
I am still seeing this or a similar issue. Should I make a new issues?
Here both the module and the function are called acorn.
# my_package/__init__.py
from .acorn import acorn
from .banana import Banana
@judfs, see https://github.com/microsoft/pyright/issues/3131. This is by design. If you think your scenario is somehow different from than one, please open a new issue.