I try to use expit(x) from SciPy. But I get this error message:
Module 'scipy.special' has no 'expit' member
This is my code:
import numpy
import scipy.special
[...]
def Activation(self, ActivationInput):
self.ActivationOutput = scipy.special.expit(ActivationInput)
return self.ActivationOutput
scipy is red underlined in VScode when I try to us it in the function Activation
The solution via Error importing scipy.special.expit was not satisfying and doesn't work.
I use Python 3.7, NumPy 1.14.5 and SciPy 1.1.0.
Other functions work, but all Ufuncs from scipy.special get this error message.
All of the ufuncs in scipy.special are written in C and so pylint cannot find the proper definition. You can tell pylint to ignore the module by adding the option --ignored-modules=scipy.special to pylint.
Adding --ignored-modules=scipy.special via the options GUI or directly to the settings.JSON file is possible, but it turns off the default options that VSCode uses with pylint.
To solve this issue, you can add both the original default options as well as the --ignored-modules flag to the settings.json file.
[CTRL]+[Shift]+p to open the command searchopen settings (JSON), which will open you settings file.settings.JSON add the key / value pairs so you file has the following{
// any other options for VSCode
"python.linting.pylintArgs": [
"--disable=all",
"--enable=F,E,unreachable,duplicate-key,unnecessary-semicolon,global-variable-not-assigned",
"--enable=unused-variable,binary-op-exception,bad-format-string,anomalous-backslash-in-string,bad-open-mode",
"--ignored-modules=scipy.special"
],
}
The first 3 lines are the default options used by VSCode for pylint. The 4th line tells pylint to ignore the scipy.special module, which will turn off the error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With