[MacPorts] #58044: Importing numpy in Python3.7 fails

MacPorts noreply at macports.org
Sun Feb 10 02:47:44 UTC 2019


#58044: Importing numpy in Python3.7 fails
-----------------------+--------------------
  Reporter:  fmw42     |      Owner:  (none)
      Type:  defect    |     Status:  closed
  Priority:  Normal    |  Milestone:
 Component:  ports     |    Version:  2.5.4
Resolution:  invalid   |   Keywords:
      Port:  py-numpy  |
-----------------------+--------------------
Description changed by mf2k:

Old description:

> On Mac OSX Sierra, I can load Python3.7 interactively. But it will not
> import numpy (py37-numpy 1.15.4_0+gfortran)
>
> I get the following:
>
> python3.7
>
> Python 3.7.2 (default, Dec 30 2018, 09:00:52)
> [Clang 9.0.0 (clang-900.0.39.2)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>> import numpy
> Traceback (most recent call last):
>   File
> "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
> /site-packages/numpy/core/__init__.py", line 16, in <module>
>     from . import multiarray
> ImportError: cannot import name 'multiarray' from 'numpy.core'
> (/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
> /site-packages/numpy/core/__init__.py)
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File
> "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
> /site-packages/numpy/__init__.py", line 142, in <module>
>     from . import add_newdocs
>   File
> "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
> /site-packages/numpy/add_newdocs.py", line 13, in <module>
>     from numpy.lib import add_newdoc
>   File
> "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
> /site-packages/numpy/lib/__init__.py", line 8, in <module>
>     from .type_check import *
>   File
> "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
> /site-packages/numpy/lib/type_check.py", line 11, in <module>
>     import numpy.core.numeric as _nx
>   File
> "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
> /site-packages/numpy/core/__init__.py", line 26, in <module>
>     raise ImportError(msg)
> ImportError:
> Importing the multiarray numpy extension module failed.  Most
> likely you are trying to import a failed build of numpy.
> If you're working with a numpy git repo, try `git clean -xdf` (removes
> all
> files not under version control).  Otherwise reinstall numpy.
>
> Original error was: cannot import name 'multiarray' from 'numpy.core'
> (/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
> /site-packages/numpy/core/__init__.py)
>
> Can you identify if I am doing something wrong or is this an issue with
> numpy?

New description:

 On Mac OSX Sierra, I can load Python3.7 interactively. But it will not
 import numpy (py37-numpy 1.15.4_0+gfortran)

 I get the following:
 {{{
 python3.7

 Python 3.7.2 (default, Dec 30 2018, 09:00:52)
 [Clang 9.0.0 (clang-900.0.39.2)] on darwin
 Type "help", "copyright", "credits" or "license" for more information.

 >>> import numpy
 Traceback (most recent call last):
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
 /site-packages/numpy/core/__init__.py", line 16, in <module>
     from . import multiarray
 ImportError: cannot import name 'multiarray' from 'numpy.core'
 (/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
 /site-packages/numpy/core/__init__.py)

 During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
 /site-packages/numpy/__init__.py", line 142, in <module>
     from . import add_newdocs
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
 /site-packages/numpy/add_newdocs.py", line 13, in <module>
     from numpy.lib import add_newdoc
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
 /site-packages/numpy/lib/__init__.py", line 8, in <module>
     from .type_check import *
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
 /site-packages/numpy/lib/type_check.py", line 11, in <module>
     import numpy.core.numeric as _nx
   File
 "/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
 /site-packages/numpy/core/__init__.py", line 26, in <module>
     raise ImportError(msg)
 ImportError:
 Importing the multiarray numpy extension module failed.  Most
 likely you are trying to import a failed build of numpy.
 If you're working with a numpy git repo, try `git clean -xdf` (removes all
 files not under version control).  Otherwise reinstall numpy.

 Original error was: cannot import name 'multiarray' from 'numpy.core'
 (/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6
 /site-packages/numpy/core/__init__.py)
 }}}

 Can you identify if I am doing something wrong or is this an issue with
 numpy?

--

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


More information about the macports-tickets mailing list