cositools / cosipy

The COSI high-level data analysis tools
Apache License 2.0
3 stars 16 forks source link

Installation broken with python Python 3.10.14 #181

Open Yong2Sheng opened 1 month ago

Yong2Sheng commented 1 month ago

I had this astromodels related issue when installing cosipy developer version:

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed cleaning build dir for astromodels
  Building wheel for antlr4-python3-runtime (setup.py) ... done
  Created wheel for antlr4-python3-runtime: filename=antlr4_python3_runtime-4.9.3-py3-none-any.whl size=144554 sha256=f9a70664abb88ba94b4f44da4230cbba90366a1b9ed64d2474032d0b8d007d5c
  Stored in directory: /Users/shengyong/Library/Caches/pip/wheels/23/cf/80/f3efa822e6ab23277902ee9165fe772eeb1dfb8014f359020a
Successfully built antlr4-python3-runtime
Failed to build astromodels
ERROR: Could not build wheels for astromodels, which is required to install pyproject.toml-based projects

It's may be the same issue #127 or related to issue #127, but I tried both python 3.10 and 3.9, and still got this error. Installation on the Ubuntu desktop is OK, so it might be a macOS specific issue.

I have a Intel Mac:

image
israelmcmc commented 1 month ago

Thanks, @Yong2Sheng . I think the solution is to specify a previous stable version of astromodels (or at least skip this one).

israelmcmc commented 1 month ago

@Yong2Sheng Can you try running just pip install astromodels? Just to make sure the issue is not with cosipy itself.

Yong2Sheng commented 1 month ago

Hi @israelmcmc,

What's worked

Install astromodels via conda and then run pip install -e ., it worked!

Failed tries

I tried :

  1. pip install astromodels after unsetting HEADAS (this will cause another error about XSPEC), and I still got the error.
  2. sudo -H pip install astromodels since it seems related to the permission, but it didn't work.
  3. pip3 install astromodels, same problem.
      OSError: [Errno 66] Directory not empty: '/private/tmp/pip-install-1r16d2mn/astromodels_9fe4ea04a7d549a0af2c47c1421bf42d/.eggs/numpy-1.26.4-py3.9-macosx-10.9-x86_64.egg/numpy-1.26.4.dist-info' -> '/private/tmp/pip-install-1r16d2mn/astromodels_9fe4ea04a7d549a0af2c47c1421bf42d/.eggs/numpy-1.26.4-py3.9-macosx-10.9-x86_64.egg/EGG-INFO'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed cleaning build dir for astromodels
  Building wheel for antlr4-python3-runtime (setup.py) ... done
  Created wheel for antlr4-python3-runtime: filename=antlr4_python3_runtime-4.9.3-py3-none-any.whl size=144554 sha256=8aa3422b2a08e98455e7a242964352b200e2df9f290c1aee6698e1d2cd78be3a
  Stored in directory: /private/var/root/Library/Caches/pip/wheels/23/cf/80/f3efa822e6ab23277902ee9165fe772eeb1dfb8014f359020a
Successfully built antlr4-python3-runtime
Failed to build astromodels
ERROR: Could not build wheels for astromodels, which is required to install pyproject.toml-based projects
israelmcmc commented 4 weeks ago

@Yong2Sheng Is the conda's astromodel's version the same as the one pip tried to install?

Yong2Sheng commented 3 weeks ago

Hi @israelmcmc, the astromodels version installed by anaconda is 2.4.2.

israelmcmc commented 3 weeks ago

I tracked down the issue and explained it here: https://github.com/threeML/astromodels/issues/209

While this is addressed on either astromodels or setuptools, we'll have to use pip install --use-pep517 with newer versions of setuptools. I'll update the installation instructions.

israelmcmc commented 3 weeks ago

Related: #187 . I added --use-pep517 to the documentation there.