Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module 'configparser' has no attribute 'SafeConfigParser' #51

Open
sachinbhoi29 opened this issue Jan 20, 2025 · 0 comments
Open

module 'configparser' has no attribute 'SafeConfigParser' #51

sachinbhoi29 opened this issue Jan 20, 2025 · 0 comments

Comments

@sachinbhoi29
Copy link

sachinbhoi29 commented Jan 20, 2025

Describe the bug
When attempting to install pyfolio (version 0.9.2), I encounter an error during the wheel building process. The error occurs due to an AttributeError related to the use of SafeConfigParser in the versioneer.py file, which is not compatible with Python 3.12. The error suggests replacing SafeConfigParser with RawConfigParser as the former was deprecated in Python 3.12.

To Reproduce
Steps to reproduce the behavior:

Create a virtual environment using Python 3.12.
Run the command pip install pyfolio or pip install alphapy (which depends on pyfolio).
See the error message during the wheel building process.
Expected behavior
The package should install successfully without errors related to SafeConfigParser.

Screenshots
Image

Collecting pyfolio
  Using cached pyfolio-0.9.2.tar.gz (91 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]
      /tmp/pip-install-avd50slw/pyfolio_541a6373515348579df94dc5b423c991/versioneer.py:468: SyntaxWarning: invalid escape sequence '\s'
        LONG_VERSION_PY['git'] = '''
      Traceback (most recent call last):
        File "/mnt/c/PERSONAL_DATA/Startups/Blockchain/venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/mnt/c/PERSONAL_DATA/Startups/Blockchain/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 "/tmp/pip-build-env-4pk6enqq/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 334, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
  [Rest of the error message truncated for brevity]

Additional context

The error is caused because SafeConfigParser was removed in Python 3.12 and replaced by RawConfigParser. Updating the code to use RawConfigParser should resolve the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant