Pylance does not recognize attribute from scipy

104 Views Asked by At

I am trying to use the scipy.stats.qmc module, but I can't import it without an error message.
Has anyone an idea how to fix this problem?

I tried:

from scipy.stats import qmc

and

from scipy.stats.qmc import Sobol, QMCEngine

Every time I get shown the error:

"Import "scipy.stats.qmc" could not be resolved"

or

"Module "scipy.stats" has no attribute "qmc"".

1

There are 1 best solutions below

2
On

Please check the version of SciPy you have.

import scipy
scipy.__version__

scipy.stats.qmc was added in SciPy 1.7.0. If you have an earlier version, you can fix the problem by updating SciPy.