MarketSquare / webdrivermanager

Python module to facilitate downloading and deploying WebDriver binaries for Chrome, Firefox, Opera & Edge
https://pypi.org/project/webdrivermanager/
MIT License
100 stars 38 forks source link

AttributeError: module 'configparser' has no attribute 'SafeConfigParser' #103

Closed AgrobnarV closed 2 months ago

AgrobnarV commented 8 months ago

When trying to install webdrivermanager v.0.10.0 with Python interpreter 3.12.0 through pip (with Python 3.10.11 works well):

Collecting webdrivermanager
  Using cached webdrivermanager-0.10.0.tar.gz (33 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [31 lines of output]
      /private/var/folders/y1/mqtqg7sn5mvb52v7j5dt918h0000gn/T/pip-install-g4pm11tr/webdrivermanager_253931cce1dd482aa41809ea230a0018/versioneer.py:421: SyntaxWarning: invalid escape sequence '\s'
        LONG_VERSION_PY['git'] = '''
      Traceback (most recent call last):
        File "/Users/admin/PycharmProjects/TrainingtRobotFramework/venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/admin/PycharmProjects/TrainingtRobotFramework/venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Users/admin/PycharmProjects/TrainingtRobotFramework/venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/y1/mqtqg7sn5mvb52v7j5dt918h0000gn/T/pip-build-env-cln_ao0p/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 355, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/y1/mqtqg7sn5mvb52v7j5dt918h0000gn/T/pip-build-env-cln_ao0p/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 325, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/y1/mqtqg7sn5mvb52v7j5dt918h0000gn/T/pip-build-env-cln_ao0p/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 507, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "/private/var/folders/y1/mqtqg7sn5mvb52v7j5dt918h0000gn/T/pip-build-env-cln_ao0p/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 341, in run_setup
          exec(code, locals())
        File "<string>", line 47, in <module>
        File "/private/var/folders/y1/mqtqg7sn5mvb52v7j5dt918h0000gn/T/pip-install-g4pm11tr/webdrivermanager_253931cce1dd482aa41809ea230a0018/versioneer.py", line 1480, in get_version
          return get_versions()["version"]
                 ^^^^^^^^^^^^^^
        File "/private/var/folders/y1/mqtqg7sn5mvb52v7j5dt918h0000gn/T/pip-install-g4pm11tr/webdrivermanager_253931cce1dd482aa41809ea230a0018/versioneer.py", line 1412, in get_versions
          cfg = get_config_from_root(root)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/y1/mqtqg7sn5mvb52v7j5dt918h0000gn/T/pip-install-g4pm11tr/webdrivermanager_253931cce1dd482aa41809ea230a0018/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: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

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

I'd happy if @rasjani can update in your repo that's why changes with "configparser" (include lib - SafeConfigParser) module were reverted in Python 3.11 and will be part of Python 3.12. Python docs in 3.11

walaa-akram commented 5 months ago

I have the same issue, would you recommend to me what I should do to install the driver manager as I'm new to robot framework and python?

Collecting webdrivermanager Using cached webdrivermanager-0.10.0.tar.gz (33 kB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [31 lines of output] C:\Users\wmoha\AppData\Local\Temp\pip-install-q6_9lbxw\webdrivermanager_b850d70023ff41c997741de9de1f1324\versioneer.py:421: SyntaxWarning: invalid escape sequence '\s' LONG_VERSION_PY['git'] = ''' Traceback (most recent call last): File "C:\Users\wmoha\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 353, in main() File "C:\Users\wmoha\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\wmoha\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 118, in get_requires_for_build_wheel return hook(config_settings) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\wmoha\AppData\Local\Temp\pip-build-env-3cmkztof\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=['wheel']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\wmoha\AppData\Local\Temp\pip-build-env-3cmkztof\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires self.run_setup() File "C:\Users\wmoha\AppData\Local\Temp\pip-build-env-3cmkztof\overlay\Lib\site-packages\setuptools\build_meta.py", line 487, in run_setup super().run_setup(setup_script=setup_script) File "C:\Users\wmoha\AppData\Local\Temp\pip-build-env-3cmkztof\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup exec(code, locals()) File "", line 47, in File "C:\Users\wmoha\AppData\Local\Temp\pip-install-q6_9lbxw\webdrivermanager_b850d70023ff41c997741de9de1f1324\versioneer.py", line 1480, in get_version return get_versions()["version"] ^^^^^^^^^^^^^^ File "C:\Users\wmoha\AppData\Local\Temp\pip-install-q6_9lbxw\webdrivermanager_b850d70023ff41c997741de9de1f1324\versioneer.py", line 1412, in get_versions cfg = get_config_from_root(root) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\wmoha\AppData\Local\Temp\pip-install-q6_9lbxw\webdrivermanager_b850d70023ff41c997741de9de1f1324\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: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output.

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

NandaBeirao commented 2 months ago

Guys, I spent hours struggling with this until I tried python -m pip install webdriver_manager.

Note that the key detail was the underscore in webdriver_manager, and it worked