scverse / squidpy

Spatial Single Cell Analysis in Python
https://squidpy.readthedocs.io/en/stable/
BSD 3-Clause "New" or "Revised" License
400 stars 70 forks source link

When attempting to install, dependency "pygeos" gives: module 'configparser' has no attribute 'SafeConfigParser' #833

Open azguan opened 1 month ago

azguan commented 1 month ago

Description

When attempting to install squidpy, I got the error:
AttributeError: module 'configparser' has no attribute 'SafeConfigParser'. Did you mean 'RawConfigParser'?

This appears to be an issue with pygeos's versioneer file, but that project appears to be deprecated in favor of shapely. Attempting to install pygeos on its own produces the same error while shapely installs without issue.

Minimal reproducible example

In Windows command prompt, with administrator permissions:

py -m pip install squidpy

Traceback

``` ... Getting requirements to build wheel ... error error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [35 lines of output] :8: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html C:\Users\gegua\AppData\Local\Temp\pip-install-7gveaeps\pygeos_509fb143a42f4536b77e25e06ae78187\versioneer.py:421: SyntaxWarning: invalid escape sequence '\s' LONG_VERSION_PY['git'] = ''' Could not find geos-config executable. Either append the path to geos-config to PATH or manually provide the include_dirs, library_dirs, libraries and other link args for compiling against a GEOS version >=3.5. Compiling pygeos/_geometry.pyx because it changed. Compiling pygeos/_geos.pyx because it changed. [1/2] Cythonizing pygeos/_geometry.pyx [2/2] Cythonizing pygeos/_geos.pyx Traceback (most recent call last): File "C:\Users\gegua\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in main() File "C:\Users\gegua\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\gegua\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\gegua\AppData\Local\Temp\pip-build-env-svo8upi_\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\gegua\AppData\Local\Temp\pip-build-env-svo8upi_\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires self.run_setup() File "C:\Users\gegua\AppData\Local\Temp\pip-build-env-svo8upi_\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup exec(code, locals()) File "", line 214, in File "C:\Users\gegua\AppData\Local\Temp\pip-install-7gveaeps\pygeos_509fb143a42f4536b77e25e06ae78187\versioneer.py", line 1480, in get_version return get_versions()["version"] ^^^^^^^^^^^^^^ File "C:\Users\gegua\AppData\Local\Temp\pip-install-7gveaeps\pygeos_509fb143a42f4536b77e25e06ae78187\versioneer.py", line 1412, in get_versions cfg = get_config_from_root(root) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\gegua\AppData\Local\Temp\pip-install-7gveaeps\pygeos_509fb143a42f4536b77e25e06ae78187\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. ```
giovp commented 1 month ago

hi @azguan yes this is a known issue ith python 3.12 we will fix it soon but don't have an estimate now, easier it is to not use python3.12 with squidpy