linuxcythonsagemanjaro

Install SageMath module from github in Linux yields Cython error


I have sagemath 9.8, python 3.11.3 and Cython 0.29.35 all installed in a machine with manjaro linux. I followed the instructions provided in the module's Github repository but I have run into errors.

There are instructions there but none of them seems to work for me.

Installing from repository gives this error:

Collecting git+https://github.com/abelfunctions/abelfunctions
  Cloning https://github.com/abelfunctions/abelfunctions to /tmp/pip-req-build-gmb8qyot
  Running command git clone --filter=blob:none --quiet https://github.com/abelfunctions/abelfunctions /tmp/pip-req-build-gmb8qyot
  Resolved https://github.com/abelfunctions/abelfunctions to commit efaf57ba61b2168adca17184d4f0836655c1138b
  Preparing metadata (setup.py) ... error

error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-req-build-gmb8qyot/setup.py", line 26, in <module>
          from Cython.Build import cythonize
      ModuleNotFoundError: No module named 'Cython'
      [end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.

Downloading the repository and installing manually with sage setup.py install results in

Traceback (most recent call last):
  File "/home/mypc/Downloads/abelfunctions/setup.py", line 26, in <module>
    from Cython.Build import cythonize
ModuleNotFoundError: No module named 'Cython'

It seems like the package installation is unable to find the Cython module. Any help would be appreciated.


Solution

  • I was able to install abelfunctions as follows.

    I installed SageMath 10.0 via conda, following

    Then in a terminal I ran

    $ conda activate sage
    $ pip install git+https://github.com/abelfunctions/abelfunctions