sorgerlab / indra

INDRA (Integrated Network and Dynamical Reasoning Assembler) is an automated model assembly system interfacing with NLP systems and databases to collect knowledge, and through a process of assembly, produce causal graphs and dynamical models.
http://indra.bio
BSD 2-Clause "Simplified" License
178 stars 68 forks source link

Having problem with Python 3.12 at macOS #1438

Closed muhammadshoaib closed 4 months ago

muhammadshoaib commented 9 months ago

Hi folks, Good day,

I am trying to install indra using pip and github. However, I am having following error.

Collecting indra
  Using cached indra-1.22.0-py3-none-any.whl (40.9 MB)
Collecting pysb>=1.3.0 (from indra)
  Using cached pysb-1.15.0.tar.gz (342 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
  ╰─> [32 lines of output]
      /private/var/folders/mp/1r6nlm5x7690cwrzx941dm4rkr70tp/T/pip-install-mlbfgabp/pysb_1ad8e5a5579d49839c74d455b0f03708/versioneer.py:467: SyntaxWarning: invalid escape sequence '\s'
        LONG_VERSION_PY['git'] = '''
      Traceback (most recent call last):
        File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Library/Frameworks/Python.framework/Versions/3.12/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 "/Library/Frameworks/Python.framework/Versions/3.12/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/mp/1r6nlm5x7690cwrzx941dm4rkr70tp/T/pip-build-env-kvra272b/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 "/private/var/folders/mp/1r6nlm5x7690cwrzx941dm4rkr70tp/T/pip-build-env-kvra272b/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/mp/1r6nlm5x7690cwrzx941dm4rkr70tp/T/pip-build-env-kvra272b/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 480, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/private/var/folders/mp/1r6nlm5x7690cwrzx941dm4rkr70tp/T/pip-build-env-kvra272b/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 53, in <module>
        File "<string>", line 16, in main
        File "/private/var/folders/mp/1r6nlm5x7690cwrzx941dm4rkr70tp/T/pip-install-mlbfgabp/pysb_1ad8e5a5579d49839c74d455b0f03708/versioneer.py", line 1405, in get_version
          return get_versions()["version"]
                 ^^^^^^^^^^^^^^
        File "/private/var/folders/mp/1r6nlm5x7690cwrzx941dm4rkr70tp/T/pip-install-mlbfgabp/pysb_1ad8e5a5579d49839c74d455b0f03708/versioneer.py", line 1339, in get_versions
          cfg = get_config_from_root(root)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/mp/1r6nlm5x7690cwrzx941dm4rkr70tp/T/pip-install-mlbfgabp/pysb_1ad8e5a5579d49839c74d455b0f03708/versioneer.py", line 399, 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

Can you help me out with this.

Kind Regards Shoaib

bgyori commented 9 months ago

Hi @muhammadshoaib, thanks for the report. This seems to be an issue in the PySB package that has since been fixed here: https://github.com/pysb/pysb/pull/579. However, PySB has not made a release since this fix. I will look into options to either have PySB released or change the dependency in INDRA. In the meantime, you could do

pip install git+https://github.com/pysb/pysb.git

to install the latest PySB from Github first, and then install INDRA to solve this.

muhammadshoaib commented 9 months ago

That solve the problem, However, there is another thing noticed that Indra required pandas<2 is there any specific reason for this? Can't we update the Indra for Pandas>2,

bgyori commented 9 months ago

In terms of the pandas dependency, I believe there is some code that will not immediately work if we change that constraint. However, it's something worth looking into both in INDRA, and some of our other packages that may assume pandas is installed via INDRA. This will take a little bit of time to investigate. I think it's very likely that if you simply keep a pandas > 2 installed locally (you can overwrite it in case INDRA's installation downgraded it), it will be fine for what you're working on.

bgyori commented 4 months ago

These have since been resolved.