How i can solve this error

C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\sklearn\base.py:318: UserWarning: Trying to unpickle estimator DecisionTreeRegressor from version 1.0.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:

warnings.warn(
C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\sklearn\base.py:318: UserWarning: Trying to unpickle estimator LabelEncoder from version 1.0.2 when using version 1.2.2. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:

warnings.warn(


how to solve this error

This isn’t really an issue with Streamlit. From the Model Persistence link in your post:

You should install the version of scikit-learn used to save the model: 1.0.2

1 Like

@Shivam_Dubey From your other post, it looks like you tried to “upgrade” scikit-learn. In your case, you need to downgrade it. You are on version 1.2.2 and need to go to version 1.0.2 (be careful not to switch the digits; you need 1.0.2 and not 1.2.0)

It’s alot of issue when I install scikit-learn ==1.0.2 version in my command prompt

You may need to downgrade other packages or use an older version of Python as well. It looks like you are working in your base environment. I recommend setting up a separate, clean environment to work in so you can handle changing versions around in a simpler manner.

I recommend installing Anaconda for that:
https://docs.anaconda.com/free/navigator/tutorials/manage-environments/

1 Like

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