[Python] Can't import MinMaxScaler "from sklearn.preprocessing import MinMaxScaler"

Discussão em 'Python' iniciado por Stack, Junho 10, 2025.

  1. Stack

    Stack Membro Participativo

    I run into the following error when running my script. Could someone please let me know what the issue could be? I have installed Sklearn on my system, and using "pip list" I can see 'sklearn 0.0" is present.

    C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pandas_datareader\compat\__init__.py:7: FutureWarning:

    pandas.util.testing is deprecated. Use the functions in the public API at pandas.testing instead.

    Traceback (most recent call last):
    File "app.py", line 9, in <module>
    import sklearn.preprocessing
    File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\sklearn\__init__.py", line 81, in <module>
    from . import __check_build # noqa: F401
    ImportError: cannot import name '__check_build' from partially initialized module 'sklearn' (most likely due to a circular import) (C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\sklearn\__init__.py)


    Code:

    import dash
    import dash_core_components as dcc
    import dash_html_components as html
    from dash.dependencies import Input, Output
    import math
    import pandas_datareader as web
    import numpy as np
    import pandas as pd
    from sklearn.preprocessing import MinMaxScaler

    Continue reading...

Compartilhe esta Página