TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases

Hi All,
When I try to import RandomForestRegressor attribute from sklearn.ensemble in streamlit application, I got this error. if anyone had come across this error, kindly help me. Thanks

code:

     > from sklearn.ensemble import RandomForestRegressor

Error:

> TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
>           Traceback:
>           File "d:\env\lib\site-packages\streamlit\scriptrunner\script_runner.py", line 557, in _run_script
>               exec(code, module.__dict__)
>           File "pytrend_ui.py", line 27, in <module>
>               from sklearn.ensemble import RandomForestRegressor
>           File "d:\env\lib\site-packages\sklearn\ensemble\__init__.py", line 5, in <module>
>               from ._base import BaseEnsemble
>           File "d:\env\lib\site-packages\sklearn\ensemble\_base.py", line 219, in <module>
>               class _BaseHeterogeneousEnsemble(

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.