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

Install issues on Ubuntu #32

Open
JohannesBuchner opened this issue Dec 9, 2024 · 1 comment
Open

Install issues on Ubuntu #32

JohannesBuchner opened this issue Dec 9, 2024 · 1 comment

Comments

@JohannesBuchner
Copy link

First, I tried pip install xspec_models_cxc[test] --verbose and pip install xspec_models_cxc, but these show

ERROR: Could not find a version that satisfies the requirement xspec_models_cxc (from versions: none)
ERROR: No matching distribution found for xspec_models_cxc

Next, I cloned the repo and ran pip3 install -v .[test].

This gives:

⌁ [user:~/Downloads/xspec-models-cxc] main ± pip3 install -v .[test]
Using pip 24.0 from /usr/lib/python3/dist-packages/pip (python 3.12)
Defaulting to user installation because normal site-packages is not writeable
  Collecting setuptools>=64.0.0
    Downloading setuptools-75.6.0-py3-none-any.whl.metadata (6.7 kB)
  Collecting wheel
    Downloading wheel-0.45.1-py3-none-any.whl.metadata (2.3 kB)
  Collecting pybind11>=2.10.0
    Downloading pybind11-2.13.6-py3-none-any.whl.metadata (9.5 kB)
  Collecting parse-xspec
    Downloading parse_xspec-0.1.0-py3-none-any.whl.metadata (6.8 kB)
  Collecting xspec-models-cxc-helpers>=0.1.0
    Downloading xspec_models_cxc_helpers-0.1.0-py3-none-any.whl.metadata (41 kB)
       ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42.0/42.0 kB 1.5 MB/s eta 0:00:00
  Downloading setuptools-75.6.0-py3-none-any.whl (1.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 6.6 MB/s eta 0:00:00
  Downloading wheel-0.45.1-py3-none-any.whl (72 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 72.5/72.5 kB 4.6 MB/s eta 0:00:00
  Downloading pybind11-2.13.6-py3-none-any.whl (243 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 243.3/243.3 kB 6.1 MB/s eta 0:00:00
  Downloading parse_xspec-0.1.0-py3-none-any.whl (22 kB)
  Downloading xspec_models_cxc_helpers-0.1.0-py3-none-any.whl (51 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 51.3/51.3 kB 3.7 MB/s eta 0:00:00
  Installing collected packages: xspec-models-cxc-helpers, wheel, setuptools, pybind11, parse-xspec
  ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
  tensorflow 2.16.1 requires ml-dtypes~=0.3.1, but you have ml-dtypes 0.4.0 which is incompatible.
  Successfully installed parse-xspec-0.1.0 pybind11-2.13.6 setuptools-75.6.0 wheel-0.45.1 xspec-models-cxc-helpers-0.1.0
  Installing build dependencies ... done
  Running command Getting requirements to build wheel
  g++ (Ubuntu 13.2.0-23ubuntu4) 13.2.0
  Copyright (C) 2023 Free Software Foundation, Inc.
  This is free software; see the source for copying conditions.  There is NO
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

  helpers/report_xspec_version: error while loading shared libraries: libgsl.so.25: cannot open shared object file: No such file or directory
  ** Using compiler: g++
  Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/usr/lib/python3/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3/dist-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-_ss6st8u/overlay/local/lib/python3.12/dist-packages/setuptools/build_meta.py", line 334, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=[])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-_ss6st8u/overlay/local/lib/python3.12/dist-packages/setuptools/build_meta.py", line 304, in _get_build_requires
      self.run_setup()
    File "/tmp/pip-build-env-_ss6st8u/overlay/local/lib/python3.12/dist-packages/setuptools/build_meta.py", line 320, in run_setup
      exec(code, locals())
    File "<string>", line 123, in <module>
    File "/usr/lib/python3.12/subprocess.py", line 571, in run
      raise CalledProcessError(retcode, process.args,
  subprocess.CalledProcessError: Command '['helpers/report_xspec_version']' returned non-zero exit status 127.
  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.
  full command: /usr/bin/python3 /usr/lib/python3/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py get_requires_for_build_wheel /tmp/tmpneofi6l8
  cwd: /mnt/data/daten/PostDoc2/home/Downloads/xspec-models-cxc
  Getting requirements to build wheel ... error
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 don't see where gsl is specified in this repo.

Initialising heasoft first resolved this issue (I had HEADAS set before). It may be helpful to print out (if pip is verbose) which compilation commands are being run.

The demo script scripts/example.py segfaults for me, but I think this may be rather matplotlib related.
Adding a matplotlibrc file with content backend: Agg avoids the segfault.

Seems to work now :)

@DougBurke
Copy link
Member

For the gsl part, I assume this is coming from XSPEC itself.

I recently tried to work on "updating / improving" the build, and split the code into two parts: a "helper" package and this one. Unfortunately I do not entirely remember why I did this. I think it was to try and simplify life for actually using this module, and I think I came to the conclusion that it probably wasn't worth it, but my memory is hazy.

I think it would make sense to switch from setuptools to meson-python, but whatever happens I have the feeling that the python packaging ecosystem isn't really designed for this sort of code, but that may be just because I have a hate-hate relationship with actually building python code ... It's also not clear that changing the build system would make much of an improvement for the issues found here.

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

2 participants