Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

Compatibility issue when building with python=3.12 #52

@Liwen-A

Description

@Liwen-A

When I tried to build the project on an EC2 instance with intel icelake x86, ubuntu 24.04, I encountered the following error when running python setup.py install

Installed /usr/local/lib/python3.12/dist-packages/pycryptodomex-3.19.1-py3.12-linux-x86_64.egg
Searching for numpy<=1.23.2,>=1.23.1
Reading https://pypi.org/simple/numpy/
Downloading https://files.pythonhosted.org/packages/f4/66/17b8e95770478436bf968353c89683ce6f9e14d92e0d4fb3111c09ba18d2/numpy-1.23.2.tar.gz#sha256=b78d00e48261fbbd04aa0d7427cf78d18401ee0abd89c7559bbf422e5b1c7d01
Best match: numpy 1.23.2
Processing numpy-1.23.2.tar.gz
Writing /tmp/easy_install-t2drbrcl/numpy-1.23.2/setup.cfg
Running numpy-1.23.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-t2drbrcl/numpy-1.23.2/egg-dist-tmp-7244l8z4
/tmp/easy_install-t2drbrcl/numpy-1.23.2/setup.py:71: RuntimeWarning: NumPy 1.23.2 may not yet support Python 3.12.
  warnings.warn(
Running from numpy source directory.
/tmp/easy_install-t2drbrcl/numpy-1.23.2/setup.py:86: DeprecationWarning:

  `numpy.distutils` is deprecated since NumPy 1.23.0, as a result
  of the deprecation of `distutils` itself. It will be removed for
  Python >= 3.12. For older Python versions it will remain present.
  It is recommended to use `setuptools < 60.0` for those Python versions.
  For more details, see:
    https://numpy.org/devdocs/reference/distutils_status_migration.html


  import numpy.distutils.command.sdist
error: Cython needs to be installed in Python as a module

I was able to solve the problem by specifying the following version for numpy and pmgy2 in setup.py:

numpy ≥ 1.26.1
gmpy2==2.2.0a1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions