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

[BUG] pip install fails on recent versions of Python #255

Open
wedgef5 opened this issue May 24, 2024 · 3 comments
Open

[BUG] pip install fails on recent versions of Python #255

wedgef5 opened this issue May 24, 2024 · 3 comments

Comments

@wedgef5
Copy link

wedgef5 commented May 24, 2024

I tried to install SHARPpy with Python 3.12. Running pip install -e . gave the following error...

Obtaining file:///usr/local/SHARPpy
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build editable did not run successfully.
  │ exit code: 1
  ╰─> [34 lines of output]
      /usr/local/SHARPpy/versioneer.py:421: SyntaxWarning: invalid escape sequence '\s'
        LONG_VERSION_PY['git'] = '''
      Traceback (most recent call last):
        File "/usr/local/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/usr/local/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 "/usr/local/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 132, in get_requires_for_build_editable
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-7zny21ym/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 448, in get_requires_for_build_editable
          return self.get_requires_for_build_wheel(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-7zny21ym/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-7zny21ym/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-7zny21ym/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 487, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-7zny21ym/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 85, in <module>
        File "/usr/local/SHARPpy/versioneer.py", line 1480, in get_version
          return get_versions()["version"]
                 ^^^^^^^^^^^^^^
        File "/usr/local/SHARPpy/versioneer.py", line 1412, in get_versions
          cfg = get_config_from_root(root)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/local/SHARPpy/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 editable 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.

My Googling revealed that SafeConfigParser was deprecated at Python 3.2 and removed in some later version. I couldn't easily determine in what release it was removed.

Steps to reproduce the behavior:

  1. Try to run pip install -e . with Python 3.12
  2. See error

Expected behavior
Install should work with recent versions of Python.

Versioning Information (please complete the following information):

  • Device: AWS cloud instance
  • OS: Centos 7
  • SHARPpy Version: git main
  • Dependency Versions: N/A
  • Screen dimensions N/A
  • SHARPpy distribution type git

**

@wxks
Copy link

wxks commented Jun 4, 2024

I'm having a similar issue running Python 3.12. After following the "installing using package managers" steps. I was able to make an environment and activate the environment, but can't download the sharppy package.

Screen Shot 2024-06-04 at 3 24 04 PM

Recreate Error:

  1. Try to run mamba install -c conda-forge sharppy with Python 3.12
  2. See error

@collin-volk
Copy link

I would recommend installing from source rather than a package manager. The package managers appear to be behind where the repo is at which is causing various issues (#254 for example).

@wedgef5
Copy link
Author

wedgef5 commented Jun 5, 2024

I did try to install from source. More recent Python releases have removed SafeConfigParser from the configparser module.

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

3 participants