aaronwmorris / indi-allsky

Software to manage a Linux-based All Sky Camera.
GNU General Public License v3.0
188 stars 31 forks source link

ImportError: numpy.core.multiarray failed to import #1329

Open TonAmSi opened 2 weeks ago

TonAmSi commented 2 weeks ago

Hello to all, I have the following problem (see error message).

What else can I try to get setup.sh to run? I have tried various sources on the www, including https://numpy.org/devdocs/user/troubleshooting-importerror.html

I am using a Raspberry Pi 5 (4 GB) with a Zwo ASI 385MC.

Many thanks in advance, Amy


AttributeError: _ARRAY_API not found Error: While importing 'app', an ImportError was raised:

Traceback (most recent call last): File "/home/darkstar/indi-allsky/virtualenv/indi-allsky/lib/python3.11/site-packages/flask/cli.py", line 245, in locate_app import(module_name) File "/home/darkstar/indi-allsky/app.py", line 3, in from indi_allsky.flask import create_app File "/home/darkstar/indi-allsky/indi_allsky/flask/init.py", line 17, in from .views import bp_allsky # noqa: E402 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/darkstar/indi-allsky/indi_allsky/flask/views.py", line 22, in from ..processing import ImageProcessor File "/home/darkstar/indi-allsky/indi_allsky/processing.py", line 11, in import cv2 File "/home/darkstar/indi-allsky/virtualenv/indi-allsky/lib/python3.11/site-packages/cv2/init.py", line 181, in bootstrap() File "/home/darkstar/indi-allsky/virtualenv/indi-allsky/lib/python3.11/site-packages/cv2/init.py", line 153, in bootstrap native_module = importlib.import_module("cv2") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ImportError: numpy.core.multiarray failed to import

TonAmSi commented 2 weeks ago

And now I've just found the solution myself. I have uninstalled NumPy2 and installed version 1.26 with: python -m pip install numpy==1.26

Now everything works and the frontend is accessible.

aaronwmorris commented 2 weeks ago

Looks like numpy 2.0 was released and it is not compatible with the rest of the modules.

TonAmSi commented 2 weeks ago

Yes, that is definitely the case! 😁 Maybe make a note of this special feature in the wiki?

aaronwmorris commented 2 weeks ago

I Just updated the requirements to prevent numpy 2.0 from being installed.

Merged #1331