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

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

Closed
jk2K opened this issue Apr 21, 2024 · 2 comments
Closed

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

jk2K opened this issue Apr 21, 2024 · 2 comments

Comments

@jk2K
Copy link

jk2K commented Apr 21, 2024

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.0rc1 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 "/Users/demo/Documents/document/codes/playground/comfyui/ComfyUI/main.py", line 217, in <module>
    init_custom_nodes()
  File "/Users/demo/Documents/document/codes/playground/comfyui/ComfyUI/nodes.py", line 1953, in init_custom_nodes
    load_custom_nodes()
  File "/Users/demo/Documents/document/codes/playground/comfyui/ComfyUI/nodes.py", line 1900, in load_custom_nodes
    success = load_custom_node(module_path, base_node_names)
  File "/Users/demo/Documents/document/codes/playground/comfyui/ComfyUI/nodes.py", line 1864, in load_custom_node
    module_spec.loader.exec_module(module)
  File "/Users/demo/Documents/document/codes/playground/comfyui/ComfyUI/custom_nodes/comfyui_controlnet_aux/__init__.py", line 2, in <module>
    from .utils import here, create_node_input_types
  File "/Users/demo/Documents/document/codes/playground/comfyui/ComfyUI/custom_nodes/comfyui_controlnet_aux/utils.py", line 4, in <module>
    import cv2
  File "/Users/demo/Documents/document/codes/playground/comfyui/ComfyUI/venv/lib/python3.9/site-packages/cv2/__init__.py", line 181, in <module>
    bootstrap()
  File "/Users/demo/Documents/document/codes/playground/comfyui/ComfyUI/venv/lib/python3.9/site-packages/cv2/__init__.py", line 153, in bootstrap
    native_module = importlib.import_module("cv2")
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
AttributeError: _ARRAY_API not found
Traceback (most recent call last):
  File "/Users/demo/Documents/document/codes/playground/comfyui/ComfyUI/nodes.py", line 1864, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/Users/demo/Documents/document/codes/playground/comfyui/ComfyUI/custom_nodes/comfyui_controlnet_aux/__init__.py", line 2, in <module>
    from .utils import here, create_node_input_types
  File "/Users/demo/Documents/document/codes/playground/comfyui/ComfyUI/custom_nodes/comfyui_controlnet_aux/utils.py", line 4, in <module>
    import cv2
  File "/Users/demo/Documents/document/codes/playground/comfyui/ComfyUI/venv/lib/python3.9/site-packages/cv2/__init__.py", line 181, in <module>
    bootstrap()
  File "/Users/demo/Documents/document/codes/playground/comfyui/ComfyUI/venv/lib/python3.9/site-packages/cv2/__init__.py", line 153, in bootstrap
    native_module = importlib.import_module("cv2")
  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: numpy.core.multiarray failed to import
@jk2K
Copy link
Author

jk2K commented Apr 21, 2024

related to opencv/opencv-python#943

@jk2K
Copy link
Author

jk2K commented Apr 21, 2024

use Python 3.12 instead of Python 3.9, now it's works

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

No branches or pull requests

1 participant