conda-forge / numexpr-feedstock

A conda-smithy repository for numexpr.
BSD 3-Clause "New" or "Revised" License
0 stars 17 forks source link

NumExpr 2.10.1 seems to require NumPy >=1.23, but declares compatibility with >=1.19 #68

Closed tadeu closed 1 month ago

tadeu commented 1 month ago

Solution to issue cannot be found in the documentation.

Issue

When numexpr 2.10.1 is installed together with numpy 1.22, on import numexpr it throws:

RuntimeError: module was compiled against NumPy C-API version 0x10 (NumPy 1.23) but the running NumPy has C-API version 0xf. Check the section C-API incompatibility at the Troubleshooting ImportError section at https://numpy.org/devdocs/user/troubleshooting-importerror.html#c-api-incompatibility for indications on how to solve this problem.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "...\envs\test-numexpr\lib\site-packages\numexpr\__init__.py", line 24, in <module>
    from numexpr.interpreter import MAX_THREADS, use_vml, __BLOCK_SIZE1__
ImportError: numpy._core.multiarray failed to import

To reproduce:

conda create -n test-numexpr numexpr=2.10.1=mkl* numpy=1.22.4 python=3.10 -c https://conda.anaconda.org/conda-forge --override-channels
conda activate test-numexpr
python -c "import numexpr"
Installed packages and conda info ``` ### Installed packages # Name Version Build Channel bzip2 1.0.8 h2466b09_7 https://conda.anaconda.org/conda-forge ca-certificates 2024.8.30 h56e8100_0 https://conda.anaconda.org/conda-forge intel-openmp 2023.2.0 h57928b3_50497 https://conda.anaconda.org/conda-forge libblas 3.9.0 20_win64_mkl https://conda.anaconda.org/conda-forge libcblas 3.9.0 20_win64_mkl https://conda.anaconda.org/conda-forge libffi 3.4.2 h8ffe710_5 https://conda.anaconda.org/conda-forge libhwloc 2.11.1 default_h8125262_1000 https://conda.anaconda.org/conda-forge libiconv 1.17 hcfcfb64_2 https://conda.anaconda.org/conda-forge liblapack 3.9.0 20_win64_mkl https://conda.anaconda.org/conda-forge libsqlite 3.46.1 h2466b09_0 https://conda.anaconda.org/conda-forge libxml2 2.12.7 h0f24e4e_4 https://conda.anaconda.org/conda-forge libzlib 1.3.1 h2466b09_2 https://conda.anaconda.org/conda-forge mkl 2023.2.0 h6a75c08_50497 https://conda.anaconda.org/conda-forge numexpr 2.10.1 mkl_py310hca09094_1 https://conda.anaconda.org/conda-forge numpy 1.22.4 py310hed7ac4c_0 https://conda.anaconda.org/conda-forge openssl 3.3.2 h2466b09_0 https://conda.anaconda.org/conda-forge pip 24.2 pyh8b19718_1 https://conda.anaconda.org/conda-forge pthreads-win32 2.9.1 h2466b09_4 https://conda.anaconda.org/conda-forge python 3.10.15 hfaddaf0_1_cpython https://conda.anaconda.org/conda-forge python_abi 3.10 5_cp310 https://conda.anaconda.org/conda-forge setuptools 75.1.0 pyhd8ed1ab_0 https://conda.anaconda.org/conda-forge tbb 2021.13.0 hc790b64_0 https://conda.anaconda.org/conda-forge tk 8.6.13 h5226925_1 https://conda.anaconda.org/conda-forge tzdata 2024b hc8b5060_0 https://conda.anaconda.org/conda-forge ucrt 10.0.22621.0 h57928b3_1 https://conda.anaconda.org/conda-forge vc 14.3 h8a93ad2_22 https://conda.anaconda.org/conda-forge vc14_runtime 14.40.33810 hcc2c482_22 https://conda.anaconda.org/conda-forge vs2015_runtime 14.40.33810 h3bf8584_22 https://conda.anaconda.org/conda-forge wheel 0.44.0 pyhd8ed1ab_0 https://conda.anaconda.org/conda-forge xz 5.2.6 h8d14728_0 https://conda.anaconda.org/conda-forge ### Environment info conda version : 24.9.1 conda-build version : 24.9.0 python version : 3.10.15.final.0 solver : libmamba (default) virtual packages : __archspec=1=skylake __conda=24.9.1=0 __cuda=11.7=0 __win=0=0 platform : win-64 user-agent : conda/24.9.1 requests/2.32.3 CPython/3.10.15 Windows/10 Windows/10.0.22631 solver/libmamba conda-libmamba-solver/24.9.0 libmambapy/1.5.10 ```
tadeu commented 1 month ago

Note the pin:

conda search -i numexpr=2.10.1=mkl_py310hca09094_1 -c https://conda.anaconda.org/conda-forge --override-channels

numexpr 2.10.1 mkl_py310hca09094_1
----------------------------------
file name   : numexpr-2.10.1-mkl_py310hca09094_1.conda
name        : numexpr
version     : 2.10.1
build       : mkl_py310hca09094_1
build number: 1
size        : 158 KB
license     : MIT
subdir      : win-64
url         : https://conda.anaconda.org/conda-forge/win-64/numexpr-2.10.1-mkl_py310hca09094_1.conda
md5         : 77956814d878a664a1712fd6897adbf7
timestamp   : 2024-10-11 16:22:09 UTC
dependencies:
  - libblas * *mkl
  - mkl >=2023.2.0,<2024.0a0
  - numpy >=1.19,<3  # <----------------
  - python >=3.10,<3.11.0a0
  - python_abi 3.10.* *_cp310
  - ucrt >=10.0.20348.0
  - vc >=14.2,<15
  - vc14_runtime >=14.29.30139
ocefpaf commented 1 month ago

It seems to require numpy 2.0 to build too. Fixing that in a moment...

xref.: https://github.com/pydata/numexpr/blob/v2.10.1/pyproject.toml#L5