Skip to content

Attribute Error with setup.py when trying to install machine-learning-datasets, calling a non-existant SafeConfigParser() #27

@Ferdodonna

Description

@Ferdodonna

Greetings,

I have encountered an issue when trying to install machine-learning-datasets - see error message below. I havent found an instance yet, where I definitely need it, but still wanted to report in case it is actually deprecated and the problem isnt on my end.

I use Jupyter with the Anaconda distribution, Python 3.13.5, pip 25.1, trying to install machine-learning-datasets.

Jupyter versions:

IPython          : 8.30.0
ipykernel        : 6.29.5
ipywidgets       : 8.1.5
jupyter_client   : 8.6.3
jupyter_core     : 5.7.2
jupyter_server   : 2.15.0
jupyterlab       : 4.3.4
nbclient         : 0.10.2
nbconvert        : 7.16.6
nbformat         : 5.10.4
notebook         : 7.3.2
qtconsole        : 5.6.1
traitlets        : 5.14.3

The error message hints at several deprecated module versions and finally throws an exception when

parser = configparser.SafeConfigParser()

is being exectued, saying that there is no attribute SafeConfigParser() that can be called. SafeConfigParser was renamed to ConfigParser in some update.

If there are some tests I should run, feel free to reach out!

Error message:

>pip install machine-learning-datasets
Collecting machine-learning-datasets
  Using cached machine_learning_datasets-0.1.16.4-py3-none-any.whl.metadata (1.3 kB)
Collecting aif360<0.4.0,>=0.3.0 (from machine-learning-datasets)
  Using cached aif360-0.3.0-py3-none-any.whl.metadata (2.7 kB)
Collecting alibi<0.6.0,>=0.5.5 (from machine-learning-datasets)
  Using cached alibi-0.5.8-py3-none-any.whl.metadata (13 kB)
Requirement already satisfied: matplotlib<4.0.0,>=3.2.2 in c:\users\suuuj\anaconda3\lib\site-packages (from machine-learning-datasets) (3.10.0)
Collecting mlxtend<0.15.0,>=0.14.0 (from machine-learning-datasets)
  Using cached mlxtend-0.14.0-py2.py3-none-any.whl.metadata (1.8 kB)
Collecting numpy<2.0.0,>=1.19.5 (from machine-learning-datasets)
  Using cached numpy-1.26.4.tar.gz (15.8 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Collecting opencv-python<5.0.0,>=4.5.1 (from machine-learning-datasets)
  Using cached opencv_python-4.12.0.88-cp37-abi3-win_amd64.whl.metadata (19 kB)
Collecting pandas<2.0.0,>=1.1.5 (from machine-learning-datasets)
  Using cached pandas-1.5.3.tar.gz (5.2 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting pathlib2<3.0.0,>=2.3.5 (from machine-learning-datasets)
  Using cached pathlib2-2.3.7.post1-py2.py3-none-any.whl.metadata (3.5 kB)
Collecting pycebox<0.0.2,>=0.0.1 (from machine-learning-datasets)
  Using cached pycebox-0.0.1.tar.gz (4.5 kB)
  Preparing metadata (setup.py) ... done
Collecting scikit-learn<0.23.0,>=0.22.2.post1 (from machine-learning-datasets)
  Using cached scikit-learn-0.22.2.post1.tar.gz (6.9 MB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: scipy<2.0.0,>=1.4.1 in c:\users\suuuj\anaconda3\lib\site-packages (from machine-learning-datasets) (1.15.3)
Collecting seaborn<0.12.0,>=0.11.1 (from machine-learning-datasets)
  Using cached seaborn-0.11.2-py3-none-any.whl.metadata (2.3 kB)
Collecting statsmodels<0.11.0,>=0.10.2 (from machine-learning-datasets)
  Using cached statsmodels-0.10.2.tar.gz (14.1 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [34 lines of output]
      C:\Users\suuuj\AppData\Local\Temp\pip-install-okjae7jx\statsmodels_1fe407c47fb642cb907520ffe58da37f\setup.py:14: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
        import pkg_resources
      C:\Users\suuuj\AppData\Local\Temp\pip-install-okjae7jx\statsmodels_1fe407c47fb642cb907520ffe58da37f\versioneer.py:564: SyntaxWarning: invalid escape sequence '\s'
        mo = re.search(r'=\s*"(.*)"', line)
      C:\Users\suuuj\AppData\Local\Temp\pip-install-okjae7jx\statsmodels_1fe407c47fb642cb907520ffe58da37f\setup.py:50: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
        req_ver = LooseVersion(SETUP_REQUIREMENTS[key])
      C:\Users\suuuj\AppData\Local\Temp\pip-install-okjae7jx\statsmodels_1fe407c47fb642cb907520ffe58da37f\setup.py:53: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
        ver = LooseVersion(mod.__version__)
      C:\Users\suuuj\AppData\Local\Temp\pip-install-okjae7jx\statsmodels_1fe407c47fb642cb907520ffe58da37f\setup.py:50: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
        req_ver = LooseVersion(SETUP_REQUIREMENTS[key])
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
          exec(compile('''
          ~~~~^^^^^^^^^^^^
          # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          ...<32 lines>...
          exec(compile(setup_py_code, filename, "exec"))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          ''' % ('C:\\Users\\suuuj\\AppData\\Local\\Temp\\pip-install-okjae7jx\\statsmodels_1fe407c47fb642cb907520ffe58da37f\\setup.py',), "<pip-setuptools-caller>", "exec"))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "<pip-setuptools-caller>", line 35, in <module>
        File "C:\Users\suuuj\AppData\Local\Temp\pip-install-okjae7jx\statsmodels_1fe407c47fb642cb907520ffe58da37f\setup.py", line 325, in <module>
          version=versioneer.get_version(),
                  ~~~~~~~~~~~~~~~~~~~~~~^^
        File "C:\Users\suuuj\AppData\Local\Temp\pip-install-okjae7jx\statsmodels_1fe407c47fb642cb907520ffe58da37f\versioneer.py", line 1480, in get_version
          return get_versions()["version"]
                 ~~~~~~~~~~~~^^
        File "C:\Users\suuuj\AppData\Local\Temp\pip-install-okjae7jx\statsmodels_1fe407c47fb642cb907520ffe58da37f\versioneer.py", line 1412, in get_versions
          cfg = get_config_from_root(root)
        File "C:\Users\suuuj\AppData\Local\Temp\pip-install-okjae7jx\statsmodels_1fe407c47fb642cb907520ffe58da37f\versioneer.py", line 342, in get_config_from_root
          parser = configparser.SafeConfigParser()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      AttributeError: module 'configparser' has no attribute 'SafeConfigParser'. Did you mean: 'RawConfigParser'?
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions