malloc: can't allocate region at import cv2

asked 2020-10-26 08:16:34 -0600

Nick7 gravatar image

Hello,

I am running python3.9.0 and after installing cv I get the following error: It looks like it's trying to allocate memory size = 18446744071760121856 ? Please help. Thank you.

nick$ python --version Python 3.9.0 nick$ python Python 3.9.0 (v3.9.0:9cf6752276, Oct 5 2020, 11:29:23) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information.

import cv2 Python(2622,0x11b7dadc0) malloc: can't allocate region * mach_vm_map(size=18446744071760121856) failed (error code=3) Python(2622,0x11b7dadc0) malloc: * set a breakpoint in malloc_error_break to debug init_dgelsd failed init Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/__init__.py", line 286, in <module> raise RuntimeError(msg) RuntimeError: Polyfit sanity test emitted a warning, most likely due to using a buggy Accelerate backend. If you compiled yourself, see site.cfg.example for information. Otherwise report this to the vendor that provided NumPy. RankWarning: Polyfit may be poorly conditioned

Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/cv2/__init__.py", line 5, in <module> from .cv2 import * ImportError: numpy.core.multiarray failed to import

edit retag flag offensive close merge delete

Comments

after installing cv

what did you do, exactly ? os ?

File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/numpy/__init__.py"

looks like a numpy problem, not an opencv one

berak gravatar imageberak ( 2020-10-26 08:50:38 -0600 )edit

I installed cv, using

pip install opencv-python

I am on macOS 10.15.2

Nick7 gravatar imageNick7 ( 2020-10-26 09:19:48 -0600 )edit

opencv does not maintain any pip binaries

Otherwise report this to the vendor that provided NumPy. RankWarning: Polyfit may be poorly conditioned

that's what you probably have to do.

berak gravatar imageberak ( 2020-10-26 09:30:08 -0600 )edit

@Nick7. After make jx. Didn't u install sudo make install?

supra56 gravatar imagesupra56 ( 2020-10-27 08:45:33 -0600 )edit