Opened 13 years ago

Last modified 8 years ago

#31419 new defect

py27-numpy: multiarray.so: wrong architecture

Reported by: macporter90210@… Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 2.0.3
Keywords: Cc: ob+macport@…, petrus.hyvonen@…, dershow, evandrix (Lee Wei Yeong)
Port: py-numpy

Description

I installed py27-numpy, but I cant seem to import it. I did a succesful port selfupdate before I installed py27-numpy.

$ python2.7
Python 2.7.2 (default, Sep 26 2011, 17:23:25) 
[GCC 4.0.1 (Apple Inc. build 5490)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/xxxxx/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/__init__.py", line 137, in <module>
    import add_newdocs
  File "/Users/xxxxx/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/add_newdocs.py", line 9, in <module>
    from numpy.lib import add_newdoc
  File "/Users/xxxxx/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/lib/__init__.py", line 4, in <module>
    from type_check import *
  File "/Users/xxxxx/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/lib/type_check.py", line 8, in <module>
    import numpy.core.numeric as _nx
  File "/Users/xxxx/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/__init__.py", line 5, in <module>
    import multiarray
ImportError: dlopen(/Users/xxxxx/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so, 2): no suitable image found.  Did find:
	/Users/xxxxx/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so: mach-o, but wrong architecture
>>> 

The version installed:

$ port installed py27-numpy
The following ports are currently installed:
  py27-numpy @1.6.1_0 (active)

The architecture

$ arch
i386
$ machine 
i486
$ file ~/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so 
/Users/xxxxx/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so: Mach-O bundle i386

Change History (24)

comment:1 Changed 13 years ago by macporter90210@…

Perhaps this is related to #28346, but that issue is closed, and I am getting this error after re-installing py27-numpy. Also, I did not install the universal variant.

comment:2 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ram@… added
Owner: changed from macports-tickets@… to dh@…
Port: py27-numpy added
Summary: numpy multiarray.so: wrong architecturepy27-numpy: multiarray.so: wrong architecture

You didn't say what version of OS X you're running (though I assume it's Leopard or Tiger, based on the fact that your Python was compiled with gcc 4.0.1), nor whether your CPU is 32-bit or 64-bit. What's the output of the following commands?

sw_vers
sysctl hw.cpu64bit_capable
port -v installed python27 py27-numpy

comment:3 Changed 13 years ago by macporter90210@…

Here is the output of the commands

$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.5.8
BuildVersion:	9L31a
$ sysctl hw.cpu64bit_capable
hw.cpu64bit_capable: 1
$ port -v installed python27 py27-numpy
The following ports are currently installed:
  py27-numpy @1.6.1_0 (active) platform='darwin 9' archs='i386'
  python27 @2.7.1_1+universal platform='darwin 9' archs='i386 ppc x86_64'
  python27 @2.7.1_2+universal platform='darwin 9' archs='i386 ppc x86_64'
  python27 @2.7.2_1+universal (active) platform='darwin 9' archs='i386 ppc x86_64'

comment:4 Changed 13 years ago by skymoo (Adam Mercer)

As your python in universal and as you have a 64bit capable system it's running in 64bit mode. NumPy is only installed 32bit it's of the wrong architecture that python is expecting.

comment:5 Changed 13 years ago by macporter90210@…

I installed py27-numpy +universal and uninstalled the deactivated components. I also installed py27-ipython +universal. However, while trying to install py27-scipy +universal, I ran into the same problem. The situation right now is:

$ port -v installed python27 py27-numpy
The following ports are currently installed:
  py27-numpy @1.6.1_0+universal (active) platform='darwin 9' archs='i386 ppc x86_64'
  python27 @2.7.2_1+universal (active) platform='darwin 9' archs='i386 ppc x86_64'

and,

$ python2.7
Python 2.7.2 (default, Sep 26 2011, 17:23:25) 
[GCC 4.0.1 (Apple Inc. build 5490)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/xxxx/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/__init__.py", line 137, in <module>
    import add_newdocs
  File "/Users/xxxxx/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/add_newdocs.py", line 9, in <module>
    from numpy.lib import add_newdoc
  File "/Users/xxxxx/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/lib/__init__.py", line 4, in <module>
    from type_check import *
  File "/Users/xxxxx/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/lib/type_check.py", line 8, in <module>
    import numpy.core.numeric as _nx
  File "/Users/xxxxx/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/__init__.py", line 5, in <module>
    import multiarray
ImportError: dlopen(/Users/xxxxxx/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so, 2): no suitable image found.  Did find:
	/Users/xxxxx/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so: mach-o, but wrong architecture
>>> 

The build is still the same

$ file ~/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so 
/Users/xxxxx/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so: Mach-O bundle i386

comment:6 Changed 12 years ago by ob+macport@…

Cc: ob+macport@… added

Cc Me!

comment:7 Changed 12 years ago by petrus.hyvonen@…

Cc: petrus.hyvonen@… added

Cc Me!

comment:8 Changed 12 years ago by jmroot (Joshua Root)

Do the archs shown by

lipo -info /path/to/multiarray.so

match those shown by port -v installed python27 py27-numpy?

comment:9 Changed 11 years ago by miriam.garcia@…

I'm having exactly the same problem in the same machine, so if you suceed to solve it, could you please give me a hint?

comment:10 Changed 11 years ago by skymoo (Adam Mercer)

Cc: ram@… removed

comment:11 Changed 10 years ago by petrrr

Cc: petr@… added

Cc Me!

comment:12 Changed 9 years ago by dershow

Cc: dersh@… added

Cc Me!

comment:13 Changed 9 years ago by dershow

Has anyone had any luck with this? I just did a full migration to 10.10, and now I have this problem (I didn't have it with 10.9). So, something about the migration, or rebuild order, likely caused it. Any ideas about a work around?

comment:14 Changed 9 years ago by michaelld (Michael Dickens)

Cc: michaelld@… added

Cc Me!

comment:15 Changed 9 years ago by dershow

It seems to also relate to this ticket: https://trac.macports.org/ticket/28346 If I run python this way: arch -i386 python Then, I can import numpy. (Although then, if I try to import pandas, which is what I really wanted, I get an error because pandas is not universal).

comment:16 Changed 9 years ago by michaelld (Michael Dickens)

Has duplicate #47240.

If you can get away with it, install "py27-numpy -universal". It will install for the native arch on the system & I think most ports will work with this variant just fine. We're working on fixing NumPy and SciPy to install as +universal correctly; it's not a simple fix.

comment:17 Changed 9 years ago by dershow

Yes, that seems to work, for numpy, and for pandas. Any idea why this was not a problem on 10.9, but is on 10.10? Did some default build flag change? Or is it just a coincidence of timing, and this issue happened to come up in the last few weeks, when I upgraded?

comment:18 Changed 9 years ago by michaelld (Michael Dickens)

I think it's a change from NumPy 1.8 to 1.9, rather than an OS issue. I see it on 10.8 and 10.10. Many MP users install once then use the install for a long time without updating; their needs are met with the basics. This issue has plagued NumPy (and SciPy) for a long time; it's not simple to fix, and changes with each major release.

comment:19 Changed 9 years ago by dershow

Thanks. If it helps at all, I know that I tend to upgrade MP often. And, I just upgraded to OS10.10 a week or so ago. So, I have used numpy 1.9 with no problems. I see that I had 1.9.2 installed, and had used numpy and pandas in the last month. So, I'm pretty sure that something about either the upgrade, or the fact of reinstalling everything, caused the problem for me.

comment:20 Changed 9 years ago by michaelld (Michael Dickens)

Interesting. Well, either way I'm glad installing as -universal seems to have done the trick. It did for me, too. I will hopefully have some time next week to look into this issue.

comment:21 Changed 9 years ago by evandrix (Lee Wei Yeong)

Cc: evandrix@… added

Cc Me!

comment:22 Changed 9 years ago by petrrr

Cc: petr@… removed

Cc Me!

comment:23 Changed 8 years ago by mf2k (Frank Schima)

Port: py-numpy added; py27-numpy removed

comment:24 Changed 8 years ago by mf2k (Frank Schima)

Cc: michaelld@… removed
Owner: changed from dh@… to michaelld@…

dh has retired. See #51239.

Note: See TracTickets for help on using tickets.