schism-dev / pyschism

Python interface for handling the SCHISM model.
https://schism-dev.github.io/schism/master/getting-started/pre-processing-with-pyschism/overview.html
Apache License 2.0
25 stars 21 forks source link

Can't install Pyschism on Hercules #124

Closed yunfangsun closed 7 months ago

yunfangsun commented 7 months ago

Hi @josephzhang8 @feiye-vims @SorooshMani-NOAA ,

I am trying to install PySchism to my env on Hercules, I met the following error messages:

pip install .
Processing /home/yunfangs/tmp/pyschism
  Preparing metadata (setup.py) ... done
Collecting boto3 (from pyschism==0.1.15.post14.dev0+fc41b51)
  Using cached boto3-1.34.85-py3-none-any.whl.metadata (6.6 kB)
Collecting cdsapi (from pyschism==0.1.15.post14.dev0+fc41b51)
  Using cached cdsapi-0.6.1.tar.gz (13 kB)
  Preparing metadata (setup.py) ... done
Collecting cf-python (from pyschism==0.1.15.post14.dev0+fc41b51)
  Using cached cf-python-3.16.1.tar.gz (1.6 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting cfgrib (from pyschism==0.1.15.post14.dev0+fc41b51)
  Using cached cfgrib-0.9.11.0-py3-none-any.whl.metadata (51 kB)
Collecting f90nml (from pyschism==0.1.15.post14.dev0+fc41b51)
  Using cached f90nml-1.4.4-py2.py3-none-any.whl.metadata (6.0 kB)
Requirement already satisfied: fsspec in /work2/noaa/nos-surge/yunfangs/conda/envs/new_ocs_schism/lib/python3.12/site-packages (from pyschism==0.1.15.post14.dev0+fc41b51) (2023.10.0)
Requirement already satisfied: geopandas in /work2/noaa/nos-surge/yunfangs/conda/envs/new_ocs_schism/lib/python3.12/site-packages (from pyschism==0.1.15.post14.dev0+fc41b51) (0.14.3)
Collecting metpy (from pyschism==0.1.15.post14.dev0+fc41b51)
  Using cached MetPy-1.6.2-py3-none-any.whl.metadata (8.7 kB)
Requirement already satisfied: netCDF4 in /work2/noaa/nos-surge/yunfangs/conda/envs/new_ocs_schism/lib/python3.12/site-packages (from pyschism==0.1.15.post14.dev0+fc41b51) (1.6.5)
Collecting netcdf-flattener>=1.2.0 (from pyschism==0.1.15.post14.dev0+fc41b51)
  Using cached netcdf_flattener-1.2.0-py3-none-any.whl
Collecting numba (from pyschism==0.1.15.post14.dev0+fc41b51)
  Using cached numba-0.59.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (2.7 kB)
Collecting ordered-set (from pyschism==0.1.15.post14.dev0+fc41b51)
  Using cached ordered_set-4.1.0-py3-none-any.whl.metadata (5.3 kB)
Requirement already satisfied: psutil in /work2/noaa/nos-surge/yunfangs/conda/envs/new_ocs_schism/lib/python3.12/site-packages (from pyschism==0.1.15.post14.dev0+fc41b51) (5.9.0)
Collecting pygeos (from pyschism==0.1.15.post14.dev0+fc41b51)
  Using cached pygeos-0.14.tar.gz (141 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
  ╰─> [35 lines of output]
      <string>:8: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
      /tmp/pip-install-0yybfqgi/pygeos_d7175e03c4b44d4ca6225c7a2e0bc887/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 "/work2/noaa/nos-surge/yunfangs/conda/envs/new_ocs_schism/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/work2/noaa/nos-surge/yunfangs/conda/envs/new_ocs_schism/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 "/work2/noaa/nos-surge/yunfangs/conda/envs/new_ocs_schism/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 "/tmp/pip-build-env-w_1ddipm/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-w_1ddipm/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-w_1ddipm/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 214, in <module>
        File "/tmp/pip-install-0yybfqgi/pygeos_d7175e03c4b44d4ca6225c7a2e0bc887/versioneer.py", line 1480, in get_version
          return get_versions()["version"]
                 ^^^^^^^^^^^^^^
        File "/tmp/pip-install-0yybfqgi/pygeos_d7175e03c4b44d4ca6225c7a2e0bc887/versioneer.py", line 1412, in get_versions
          cfg = get_config_from_root(root)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-install-0yybfqgi/pygeos_d7175e03c4b44d4ca6225c7a2e0bc887/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 have tried to use pip install pyschism and clone repo for versions of 0.1.14 and 0.1.15, could you please let me know how to fix this error? Thank you very much!

Best,

Yunfang

SorooshMani-NOAA commented 7 months ago

@yunfangsun I suggest that you install pyschism dependencies using conda to avoid failure during installation. I would usually install these in a conda environment before installing pyschism:

yunfangsun commented 7 months ago

Hi @SorooshMani-NOAA ,

Thank you, the problem is solved.