ImportError: Cannot Import Name Signature
I am tying to modify the original sklearn.CalibrationCV to create my won version. The original code has 'from .utils.fixes import signature'. So I did the following in my version:
Solution 1:
- In python 2, the
inspectmodule does not have asignaturemethod. - In python 3, the
inspectmodule does have asignaturemethod.
This code is just trying to work with both python 2 and 3.
You may want to use the funcsigs module if you are using python 2, or use sklearn.externals.funcsigs directly (for version sklearn >= 0.17).
Solution 2:
The accepted answer doesn't work with the latest version of sklearn.
Please install funcsigs directly using
pip install funcsigs
and use from funcsigs import signature instead.
Post a Comment for "ImportError: Cannot Import Name Signature"