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

[Bug] ImportError: numpy.core.multiarray failed to import #786

Open
3 tasks done
alaa-shubbak opened this issue Aug 23, 2024 · 0 comments
Open
3 tasks done

[Bug] ImportError: numpy.core.multiarray failed to import #786

alaa-shubbak opened this issue Aug 23, 2024 · 0 comments
Assignees
Labels
Bug Something isn't working

Comments

@alaa-shubbak
Copy link

Branch

main branch (1.x version)

Prerequisite

Environment

same error
A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.0 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last): File "/scratch/shubbak/mmselfsup/mmselfsup/utils/collect_env.py", line 2, in
from mmcv.utils import collect_env as collect_base_env
File "/home/shubbak/.local/lib/python3.10/site-packages/mmcv/init.py", line 4, in
from .image import *
File "/home/shubbak/.local/lib/python3.10/site-packages/mmcv/image/init.py", line 2, in
from .colorspace import (bgr2gray, bgr2hls, bgr2hsv, bgr2rgb, bgr2ycbcr,
File "/home/shubbak/.local/lib/python3.10/site-packages/mmcv/image/colorspace.py", line 4, in
import cv2
File "/home/shubbak/.local/lib/python3.10/site-packages/cv2/init.py", line 181, in
bootstrap()
File "/home/shubbak/.local/lib/python3.10/site-packages/cv2/init.py", line 153, in bootstrap
native_module = importlib.import_module("cv2")
File "/software/python/3.10.6/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
AttributeError: _ARRAY_API not found
Traceback (most recent call last):
File "/scratch/shubbak/mmselfsup/mmselfsup/utils/collect_env.py", line 2, in
from mmcv.utils import collect_env as collect_base_env
File "/home/shubbak/.local/lib/python3.10/site-packages/mmcv/init.py", line 4, in
from .image import *
File "/home/shubbak/.local/lib/python3.10/site-packages/mmcv/image/init.py", line 2, in
from .colorspace import (bgr2gray, bgr2hls, bgr2hsv, bgr2rgb, bgr2ycbcr,
File "/home/shubbak/.local/lib/python3.10/site-packages/mmcv/image/colorspace.py", line 4, in
import cv2
File "/home/shubbak/.local/lib/python3.10/site-packages/cv2/init.py", line 181, in
bootstrap()
File "/home/shubbak/.local/lib/python3.10/site-packages/cv2/init.py", line 153, in bootstrap
native_module = importlib.import_module("cv2")
File "/software/python/3.10.6/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: numpy.core.multiarray failed to import

Describe the bug

I got an error when try to verification the installation . as bellow
ython
Python 3.10.6 (main, Sep 6 2022, 15:45:25) [GCC 10.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import mmselfsup

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.0 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last): File "", line 1, in
File "/scratch/shubbak/mmselfsup/mmselfsup/init.py", line 2, in
import mmcls
File "/home/shubbak/.local/lib/python3.10/site-packages/mmcls/init.py", line 2, in
import mmcv
File "/home/shubbak/.local/lib/python3.10/site-packages/mmcv/init.py", line 4, in
from .image import *
File "/home/shubbak/.local/lib/python3.10/site-packages/mmcv/image/init.py", line 2, in
from .colorspace import (bgr2gray, bgr2hls, bgr2hsv, bgr2rgb, bgr2ycbcr,
File "/home/shubbak/.local/lib/python3.10/site-packages/mmcv/image/colorspace.py", line 4, in
import cv2
File "/home/shubbak/.local/lib/python3.10/site-packages/cv2/init.py", line 181, in
bootstrap()
File "/home/shubbak/.local/lib/python3.10/site-packages/cv2/init.py", line 153, in bootstrap
native_module = importlib.import_module("cv2")
File "/software/python/3.10.6/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
AttributeError: _ARRAY_API not found
Traceback (most recent call last):
File "", line 1, in
File "/scratch/shubbak/mmselfsup/mmselfsup/init.py", line 2, in
import mmcls
File "/home/shubbak/.local/lib/python3.10/site-packages/mmcls/init.py", line 2, in
import mmcv
File "/home/shubbak/.local/lib/python3.10/site-packages/mmcv/init.py", line 4, in
from .image import *
File "/home/shubbak/.local/lib/python3.10/site-packages/mmcv/image/init.py", line 2, in
from .colorspace import (bgr2gray, bgr2hls, bgr2hsv, bgr2rgb, bgr2ycbcr,
File "/home/shubbak/.local/lib/python3.10/site-packages/mmcv/image/colorspace.py", line 4, in
import cv2
File "/home/shubbak/.local/lib/python3.10/site-packages/cv2/init.py", line 181, in
bootstrap()
File "/home/shubbak/.local/lib/python3.10/site-packages/cv2/init.py", line 153, in bootstrap
native_module = importlib.import_module("cv2")
File "/software/python/3.10.6/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: numpy.core.multiarray failed to import

Reproduces the problem - code sample

running verifiaction by bellow

python ---import mmselfsup
print(mmselfsup.version)

Reproduces the problem - command or script

No response

Reproduces the problem - error message

No response

Additional information

No response

@alaa-shubbak alaa-shubbak added the Bug Something isn't working label Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants