Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

numba 0.56.4 requires numpy<1.24,>=1.18, but you have numpy 1.24.2 which is incompatible. #8875

Closed
Marietto2008 opened this issue Apr 3, 2023 · 14 comments
Labels
question Notes an issue as a question

Comments

@Marietto2008
Copy link

Marietto2008 commented Apr 3, 2023

Hello.

I'm trying to install numpy on my Debian 11 + python 3.8,but :

root@marietto:/mnt/zroot2/zroot2/AlexaChatGPT# pip3 install numpy

Collecting numpy
  Downloading numpy-1.24.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 17.3/17.3 MB 6.5 MB/s eta 0:00:00
Installing collected packages: numpy

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. 
This behaviour is the source of the following dependency conflicts.

numba 0.56.4 requires numpy<1.24,>=1.18, but you have numpy 1.24.2 which is incompatible.

how to fix it ? thanks.

@esc
Copy link
Member

esc commented Apr 3, 2023

Hello.

I'm trying to install numpy on my Debian 11 + python 3.8,but :

root@marietto:/mnt/zroot2/zroot2/AlexaChatGPT# pip3 install numpy

Collecting numpy
  Downloading numpy-1.24.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 17.3/17.3 MB 6.5 MB/s eta 0:00:00
Installing collected packages: numpy

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. 
This behaviour is the source of the following dependency conflicts.

numba 0.56.4 requires numpy<1.24,>=1.18, but you have numpy 1.24.2 which is incompatible.

how to fix it ? thanks.

Install a NumPy lower than 1.24 and then try again?

@Marietto2008
Copy link
Author

Marietto2008 commented Apr 3, 2023

root@marietto:/mnt/zroot2/zroot2/AlexaChatGPT# pip3 install numpy==1.24

Collecting numpy==1.24
  Downloading numpy-1.24.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 17.3/17.3 MB 5.7 MB/s eta 0:00:00
Installing collected packages: numpy
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
numba 0.56.4 requires numpy<1.24,>=1.18, but you have numpy 1.24.0 which is incompatible.
evaluate 0.4.0 requires responses<0.19, but you have responses 0.23.1 which is incompatible.
datasets 2.11.0 requires responses<0.19, but you have responses 0.23.1 which is incompatible.
Successfully installed numpy-1.24.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: [https://pip.pypa.io/warnings/venv](https://l.facebook.com/l.php?u=https%3A%2F%2Fpip.pypa.io%2Fwarnings%2Fvenv%3Ffbclid%3DIwAR2oAxVZzXDgaNDvuKl9Y4GzKOpQvnva-WSR4nyx7zBG6tiKZw-eHQFY8X0&h=AT2sSzWPbol_nYgu0e-LQYGHxasX-bztmg7UxVN8mQi7vQAl2Ni14SyvUt77tOd6Rplw1F1e32222NrEGhPyIgRoHA56W5z8EB6UOOjT2jN_BUaPKKaynvQp7Q&__tn__=-UK-R&c[0]=AT1KQf1bX4Qeo1UAbmMkTOr7DTWHBZ-acUBMgpKUSxOEtYoLZgBU3PuLLow5Q-esTtxJjEFb58V9Ma7InTz8fx1ETABNftcDhlgBAxOylo1IeGmWq-usDS3J9Pwf2yvC7bxCES0NMWBlfzossvd4dOmN-s4)

root@marietto:/mnt/zroot2/zroot2/AlexaChatGPT# pip3 uninstall responses

Found existing installation: responses 0.23.1
Uninstalling responses-0.23.1:
  Would remove:
    /usr/local/lib/python3.8/site-packages/responses-0.23.1.dist-info/*
    /usr/local/lib/python3.8/site-packages/responses/*
Proceed (Y/n)? y
  Successfully uninstalled responses-0.23.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: [https://pip.pypa.io/warnings/venv](https://pip.pypa.io/warnings/venv?fbclid=IwAR0F9mj5TnO8f6B9HcI9w5zrNHNTTl56pTna3wreY4mU-ug7vlWd1Sce86s)

root@marietto:/mnt/zroot2/zroot2/AlexaChatGPT# pip3 install responses==0.18

Collecting responses==0.18
  Using cached responses-0.18.0-py3-none-any.whl (38 kB)
Requirement already satisfied: requests<3.0,>=2.0 in /usr/local/lib/python3.8/site-packages (from responses==0.18) (2.28.2)
Requirement already satisfied: urllib3>=1.25.10 in /usr/local/lib/python3.8/site-packages (from responses==0.18) (1.26.15)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.8/site-packages (from requests<3.0,>=2.0->responses==0.18) (3.4)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.8/site-packages (from requests<3.0,>=2.0->responses==0.18) (2022.12.7)
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.8/site-packages (from requests<3.0,>=2.0->responses==0.18) (3.1.0)
Installing collected packages: responses
Successfully installed responses-0.18.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: [https://pip.pypa.io/warnings/venv](https://l.facebook.com/l.php?u=https%3A%2F%2Fpip.pypa.io%2Fwarnings%2Fvenv%3Ffbclid%3DIwAR2_DIFgiHkJ_hb-xuODbfcEmxgWVil2CFiwa9RGJ-Ka0-ISsEnCaDZ61UI&h=AT2sSzWPbol_nYgu0e-LQYGHxasX-bztmg7UxVN8mQi7vQAl2Ni14SyvUt77tOd6Rplw1F1e32222NrEGhPyIgRoHA56W5z8EB6UOOjT2jN_BUaPKKaynvQp7Q&__tn__=-UK-R&c[0]=AT1KQf1bX4Qeo1UAbmMkTOr7DTWHBZ-acUBMgpKUSxOEtYoLZgBU3PuLLow5Q-esTtxJjEFb58V9Ma7InTz8fx1ETABNftcDhlgBAxOylo1IeGmWq-usDS3J9Pwf2yvC7bxCES0NMWBlfzossvd4dOmN-s4)

root@marietto:/mnt/zroot2/zroot2/AlexaChatGPT# pip3 install numpy

Requirement already satisfied: numpy in /usr/local/lib/python3.8/site-packages (1.24.0)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: [https://pip.pypa.io/warnings/venv](https://pip.pypa.io/warnings/venv?fbclid=IwAR0LwyquuZVPg-Y3OZdJX3pQw2Ljzr6kbuw7cwLhWLfNsH8FR20Bn2kHGGM)

root@marietto:/mnt/zroot2/zroot2/AlexaChatGPT# python3 bing-chatgpt.py
Traceback (most recent call last):
  File "bing-chatgpt.py", line 4, in <module>
    import whisper
  File "/usr/local/lib/python3.8/site-packages/whisper/__init__.py", line 13, in <module>
    from .model import ModelDimensions, Whisper
  File "/usr/local/lib/python3.8/site-packages/whisper/model.py", line 13, in <module>
    from .transcribe import transcribe as transcribe_function
  File "/usr/local/lib/python3.8/site-packages/whisper/transcribe.py", line 20, in <module>
    from .timing import add_word_timestamps
  File "/usr/local/lib/python3.8/site-packages/whisper/timing.py", line 7, in <module>
    import numba
  File "/usr/local/lib/python3.8/site-packages/numba/__init__.py", line 42, in <module>
    from numba.np.ufunc import (vectorize, guvectorize, threading_layer,
  File "/usr/local/lib/python3.8/site-packages/numba/np/ufunc/__init__.py", line 3, in <module>
    from numba.np.ufunc.decorators import Vectorize, GUVectorize, vectorize, guvectorize
  File "/usr/local/lib/python3.8/site-packages/numba/np/ufunc/decorators.py", line 3, in <module>
    from numba.np.ufunc import _internal
SystemError: initialization of _internal failed without raising an exception

@esc
Copy link
Member

esc commented Apr 4, 2023

root@marietto:/mnt/zroot2/zroot2/AlexaChatGPT# pip3 install numpy==1.24

@Marietto2008 I suggested to install a NumPy lower than 1.24 -- not 1.24 itself. Numba 0.56.4 does not support NumPy 1.24 and beyond.

@esc esc added the question Notes an issue as a question label Apr 4, 2023
@fcolecumberri
Copy link

I understand by #8691 and #8837 that the next release will have support for numpy 1.24, any idea when will that be?

@stuartarchibald
Copy link
Contributor

stuartarchibald commented Apr 17, 2023

@fcolecumberri Numba 0.57.0 release candidate information can be found in #8841.

@Frank-Steiner
Copy link

There are too many other packages that require a recent numpy (like tellurium) so that using an older numpy version is difficult. Hoping that 0.57 comes soon...

@stuartarchibald
Copy link
Contributor

The checklist for releasing 0.57 is here #8921 (0.57 has NumPy 1.24 support). Please do subscribe to that if it's important to you. Closing this question as it seems to be resolved. Thanks!

@dudulasry
Copy link

I also have some difficulties using numba in my project. I'd like to upgrade to latest NumPy, but it's problematic since numba needs < 1.23

@esc
Copy link
Member

esc commented Jun 5, 2023

I also have some difficulties using numba in my project. I'd like to upgrade to latest NumPy, but it's problematic since numba needs < 1.23

Numba 0.57.0 supports numpy < 1.25 -- if you continue to encounter issues, please do open a new issue. Thank you.

@dudulasry
Copy link

Cool, just saw that. Will try to use numba=0.57 then

@mirekphd
Copy link

mirekphd commented Jul 22, 2023

Numba 0.57.0 supports numpy < 1.25 -- if you continue to encounter issues, please do open a new issue. Thank you.

Literally within days numpy bumped its latest stable version to 1.25.1... and it's deja vu all over again:

Installed /opt/conda/lib/python3.9/site-packages/shap-0.42.1-py3.9-linux-x86_64.egg
Processing dependencies for shap==0.42.1
error: numpy 1.25.1 is installed but numpy<1.25,>=1.21 is required by {'numba'}
The command [..] returned a non-zero code: 1

Version capping is the root of the issue here and it is generally discouraged. Please consider uncapping.

To quote Brett Cannon (Python Steering Council Member and packaging expert):

Libraries/packages should be setting a floor, and if necessary excluding known buggy versions, but otherwise don’t cap the maximum version as you can’t predict future compatibility

A longer rationale why this is generally considered best practice can be found here - and "it does not scale" is our particular pain point (in universal reproducible containerized dev environments for data science users).

@esc
Copy link
Member

esc commented Jul 31, 2023

Version capping is the root of the issue here and it is generally discouraged. Please consider uncapping.

To quote Brett Cannon (Python Steering Council Member and packaging expert):

Libraries/packages should be setting a floor, and if necessary excluding known buggy versions, but otherwise don’t cap the maximum version as you can’t predict future compatibility

NumPy minor upgrades will almost always break Numba. In this case we prefer to exit early with an error instead of risking a segfault or other undefined behaviour. Having said that, we are working with the NumPy community to enable better testing of development versions and release candidates so that we can eventually stop capping NumPy.

@FrenchBen
Copy link

- numba==0.57.1
- numpy==1.24.4

ImportError: Numba needs NumPy 1.24 or less

Same as everyone, but worse as @esc mentioned

Numba 0.57.0 supports numpy < 1.25

The above pip requirements doesn't seem to match that statement.

@esc
Copy link
Member

esc commented Aug 25, 2023

- numba==0.57.1
- numpy==1.24.4

ImportError: Numba needs NumPy 1.24 or less

Same as everyone, but worse as @esc mentioned

Numba 0.57.0 supports numpy < 1.25

The above pip requirements doesn't seem to match that statement.

Can you add steps or hints to reproduce, I wasn't able to:

$ conda create -n test-install
$ conda activate test-install
$ pip install numba==0.57.1 numpy==1.24.4                                                                                           
Collecting numba==0.57.1
  Obtaining dependency information for numba==0.57.1 from https://files.pythonhosted.org/packages/ce/eb/c982ad64cc2a4cc0a6b95ea94da5566874a6eaffc585c789ef2dd77fc06a/numba-0.57.1-cp311-cp311-macosx_11_0_arm64.whl.metadata
  Downloading numba-0.57.1-cp311-cp311-macosx_11_0_arm64.whl.metadata (2.7 kB)
Collecting numpy==1.24.4
  Obtaining dependency information for numpy==1.24.4 from https://files.pythonhosted.org/packages/c0/bc/77635c657a3668cf652806210b8662e1aff84b818a55ba88257abf6637a8/numpy-1.24.4-cp311-cp311-macosx_11_0_arm64.whl.metadata
  Downloading numpy-1.24.4-cp311-cp311-macosx_11_0_arm64.whl.metadata (5.6 kB)
Collecting llvmlite<0.41,>=0.40.0dev0 (from numba==0.57.1)
  Obtaining dependency information for llvmlite<0.41,>=0.40.0dev0 from https://files.pythonhosted.org/packages/d3/fe/14ad307b173df79e8792f253c67e9edde6aefa00b25de031863662d223b4/llvmlite-0.40.1-cp311-cp311-macosx_11_0_arm64.whl.metadata
  Downloading llvmlite-0.40.1-cp311-cp311-macosx_11_0_arm64.whl.metadata (4.7 kB)
Downloading numba-0.57.1-cp311-cp311-macosx_11_0_arm64.whl (2.5 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.5/2.5 MB 4.4 MB/s eta 0:00:00
Downloading numpy-1.24.4-cp311-cp311-macosx_11_0_arm64.whl (13.8 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.8/13.8 MB 4.6 MB/s eta 0:00:00
Downloading llvmlite-0.40.1-cp311-cp311-macosx_11_0_arm64.whl (28.1 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 28.1/28.1 MB 3.4 MB/s eta 0:00:00
Installing collected packages: numpy, llvmlite, numba
Successfully installed llvmlite-0.40.1 numba-0.57.1 numpy-1.24.4
$ python
impPython 3.11.4 (main, Jul  5 2023, 08:40:20) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numba
>>>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Notes an issue as a question
Projects
None yet
Development

No branches or pull requests

8 participants