Ошибка при установке библиотеки Theano: AttributeError: module 'configparser' has no attribute 'SafeConfigParser'

Использую пайтон версии 3.12 При попытке установить библиотеку выводит это:

Collecting Theano
  Using cached Theano-1.0.5.tar.gz (2.8 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [15 lines of output]
      C:\Users\ПК\AppData\Local\Temp\pip-install-tfygfw2t\theano_ed518f9a36fe42d8997e5310434f14f7\versioneer.py:421: SyntaxWarning: invalid escape sequence '\s'
        LONG_VERSION_PY['git'] = '''
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\ПК\AppData\Local\Temp\pip-install-tfygfw2t\theano_ed518f9a36fe42d8997e5310434f14f7\setup.py", line 74, in <module>
          version_data = versioneer.get_versions()
                         ^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ПК\AppData\Local\Temp\pip-install-tfygfw2t\theano_ed518f9a36fe42d8997e5310434f14f7\versioneer.py", line 1412, in get_versions
          cfg = get_config_from_root(root)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ПК\AppData\Local\Temp\pip-install-tfygfw2t\theano_ed518f9a36fe42d8997e5310434f14f7\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]

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.
PS C:\Users\ПК\pythonProject> pip install Theano 1.0.5
Collecting Theano
  Using cached Theano-1.0.5.tar.gz (2.8 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [15 lines of output]
      C:\Users\ПК\AppData\Local\Temp\pip-install-b7yq08on\theano_210712a60e9b486889181c5af072f0cc\versioneer.py:421: SyntaxWarning: invalid escape sequence '\s'
        LONG_VERSION_PY['git'] = '''
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\ПК\AppData\Local\Temp\pip-install-b7yq08on\theano_210712a60e9b486889181c5af072f0cc\setup.py", line 74, in <module>
          version_data = versioneer.get_versions()
                         ^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ПК\AppData\Local\Temp\pip-install-b7yq08on\theano_210712a60e9b486889181c5af072f0cc\versioneer.py", line 1412, in get_versions
          cfg = get_config_from_root(root)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ПК\AppData\Local\Temp\pip-install-b7yq08on\theano_210712a60e9b486889181c5af072f0cc\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.

Ответы (1 шт):

Автор решения: Bi Diaz

А эта версия python совместима с этой библиотекой? Проверь Если да -

  1. Обнови pip
  2. Обнови configparser
  3. Снова попробуй установить библиотеку

Если нет - используй другую версию python

→ Ссылка