lesgourg / class_public

Public repository of the Cosmic Linear Anisotropy Solving System (master for the most recent version of the standard code; GW_CLASS to include Cosmic Gravitational Wave Background anisotropies; classnet branch for acceleration with neutral networks; ExoCLASS branch for exotic energy injection; class_matter branch for FFTlog)
218 stars 291 forks source link

Issue pip installing classy #553

Closed snesseris closed 9 months ago

snesseris commented 9 months ago

Hi all,

I'm having an issue pip installing classy, especially at the colab. After running !pip install classy

I get the error:

Collecting classy
  Downloading classy-3.2.0.1.tar.gz (9.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9.9/9.9 MB 5.8 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: classy
  error: subprocess-exited-with-error

  × Building wheel for classy (pyproject.toml) 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.
  Building wheel for classy (pyproject.toml) ... error
  ERROR: Failed building wheel for classy
Failed to build classy
ERROR: Could not build wheels for classy, which is required to install pyproject.toml-based projects

The same error happens with previous version of classy as well, eg when installing with !pip install classy==2.9.4. Information on the python setup of the colab can be seen here: https://colab.research.google.com/notebooks/relnotes.ipynb

This stack-exchange post suggests this might be a python/pip issue, but I wanted to make sure it's not something related to classy (also to bring it to the attention of the devs).

Using classy with the Colab is particularly useful when teaching Cosmology (everyone has a google account!) and any help would be appreciated 😄

brinckmann commented 9 months ago

Hi Savvas,

I can't be sure since the error message is sparse on information, but I wonder if this might be a Cython issue. CLASS without changes isn't compatible with Cython v3. See issue #531 , with two options, you can try to either make the necessary changes in CLASS (see, e.g., https://github.com/NEDE-Cosmo/TriggerCLASS/issues/1 ) or use Cython 0.29 like suggested by lgarrison.

Best, Thejs

snesseris commented 9 months ago

Perfect, thanks! 👍