[MacPorts] #63294: py-numpy: No module named 'numpy.core._multiarray_umath'

MacPorts noreply at macports.org
Sun Jul 25 16:08:22 UTC 2021


#63294: py-numpy: No module named 'numpy.core._multiarray_umath'
-----------------------+-----------------------
  Reporter:  fmw42     |      Owner:  michaelld
      Type:  defect    |     Status:  assigned
  Priority:  Normal    |  Milestone:
 Component:  ports     |    Version:  2.7.1
Resolution:            |   Keywords:
      Port:  py-numpy  |
-----------------------+-----------------------

Comment (by fmw42):

 A simple import of OpenCV and Numpy fails. The script is called as

 python3.9 python_import_numpy.py

 and contains simply:


 {{{
 import cv2
 import numpy as np

 }}}

 Here is what returns:


 {{{
 python3.9 python_import_numpy.py

 OpenCV bindings requires "numpy" package.
 Install it via command:
     pip install numpy
 Traceback (most recent call last):
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7
 /site-packages/numpy/core/__init__.py", line 22, in <module>
     from . import multiarray
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7
 /site-packages/numpy/core/multiarray.py", line 12, in <module>
     from . import overrides
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7
 /site-packages/numpy/core/overrides.py", line 7, in <module>
     from numpy.core._multiarray_umath import (
 ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

 During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
   File "/Users/fred/Desktop/python_import_numpy.py", line 1, in <module>
     import cv2
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7
 /site-packages/cv2/__init__.py", line 8, in <module>
     import numpy
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7
 /site-packages/numpy/__init__.py", line 150, in <module>
     from . import core
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7
 /site-packages/numpy/core/__init__.py", line 48, in <module>
     raise ImportError(msg)
 ImportError:

 IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

 Importing the numpy C-extensions failed. This error can happen for
 many reasons, often due to issues with your setup or how NumPy was
 installed.

 We have compiled some common reasons and troubleshooting tips at:

     https://numpy.org/devdocs/user/troubleshooting-importerror.html

 Please note and check the following:

   * The Python version is: Python3.9 from "/opt/local/bin/python3.9"
   * The NumPy version is: "1.21.1"

 and make sure that they are the versions you expect.
 Please carefully study the documentation linked above for further help.

 Original error was: No module named 'numpy.core._multiarray_umath'

 }}}


 My .profile file includes:

 export
 PYTHONPATH=/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9
 /site-packages

 My Ports include:


 {{{
   opencv3 @3.4.14_0 (active)

   py39-alabaster @0.7.12_0 (active)
   py39-babel @2.9.0_0 (active)
   py39-beaker @1.11.0_0 (active)
   py39-cairo @1.20.1_0+x11 (active)
   py39-certifi @2021.5.30_0 (active)
   py39-chardet @4.0.0_0 (active)
   py39-charset-normalizer @2.0.3_0 (active)
   py39-cycler @0.10.0_0 (active)
   py39-cython @0.29.24_0 (active)
   py39-dateutil @2.8.2_0 (active)
   py39-decorator @5.0.9_0 (active)
   py39-docutils @0.17.1_0 (active)
   py39-gobject3 @3.38.0_0 (active)
   py39-idna @3.2_0 (active)
   py39-imageio @2.9.0_0 (active)
   py39-imagesize @1.2.0_0 (active)
   py39-jinja2 @3.0.1_0 (active)
   py39-joblib @1.0.1_0 (active)
   py39-kiwisolver @1.3.1_0 (active)
   py39-lxml @4.4.1_0 (active)
   py39-mako @1.1.4_0 (active)
   py39-markdown @3.3.4_0 (active)
   py39-markupsafe @2.0.1_0 (active)
   py39-matplotlib @3.4.2_0+cairo+webagg (active)
   py39-mypy @0.910_0 (active)
   py39-mypy_extensions @0.4.3_0 (active)
   py39-networkx @2.5.1_0 (active)
   py39-numpy @1.21.1_0+gfortran+openblas (active)
   py39-olefile @0.46_0 (active)
   py39-opencv3 @3.4.14_0 (active)
   py39-packaging @21.0_0 (active)
   py39-parsing @2.4.7_0 (active)
   py39-Pillow @8.3.1_0 (active)
   py39-pip @21.1.3_0 (active)
   py39-pybind11 @2.7.0_0 (active)
   py39-pygments @2.9.0_0 (active)
   py39-pywavelets @1.1.1_0 (active)
   py39-requests @2.26.0_1 (active)
   py39-roman @3.3_0 (active)
   py39-scikit-image @0.18.1_0 (active)
   py39-scikit-learn @0.24.2_0 (active)
   py39-scipy @1.7.0_0+gfortran+openblas (active)
   py39-setuptools @57.1.0_0 (active)
   py39-setuptools_scm @6.0.1_0 (active)
   py39-six @1.16.0_0 (active)
   py39-snowballstemmer @2.1.0_0 (active)
   py39-sphinx @4.1.1_0 (active)
   py39-sphinxcontrib-applehelp @1.0.2_0 (active)
   py39-sphinxcontrib-devhelp @1.0.2_0 (active)
   py39-sphinxcontrib-htmlhelp @2.0.0_0 (active)
   py39-sphinxcontrib-jsmath @1.0.1_1 (active)
   py39-sphinxcontrib-qthelp @1.0.3_0 (active)
   py39-sphinxcontrib-serializinghtml @1.1.5_0 (active)
   py39-sphinxcontrib-websupport @1.2.2_0 (active)
   py39-threadpoolctl @2.2.0_0 (active)
   py39-tifffile @2021.7.2_0 (active)
   py39-tkinter @3.9.6_0 (active)
   py39-toml @0.10.2_0 (active)
   py39-tornado @6.1_0 (active)
   py39-typed-ast @1.4.3_0 (active)
   py39-typing_extensions @3.10.0.0_0 (active)
   py39-tz @2021.1_0 (active)
   py39-urllib3 @1.26.6_0 (active)
   py39-wand @0.6.6_0 (active)

   python2_select @0.0_3 (active)
   python3_select @0.0_2 (active)

 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/63294#comment:4>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list