Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > NumPy installation won't import correctly

Reply
Thread Tools

NumPy installation won't import correctly

 
 
Ethos
Guest
Posts: n/a
 
      12-01-2009
I installed NumPy for python 2.6 on my leopard macbook, using the
nifty mac installer they now provide. I have the 2.6 official python
distro installed on my computer, in addition to the 2.5 that is native
on the mac. When I went to test out the installation, with 2.6, it
gave me this:

>>> import numpy

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/numpy/__init__.py", line 132, in <module>
import add_newdocs
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/numpy/add_newdocs.py", line 9, in <module>
from lib import add_newdoc
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/numpy/lib/__init__.py", line 4, in <module>
from type_check import *
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/numpy/lib/type_check.py", line 8, in <module>
import numpy.core.numeric as _nx
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
python2.6/site-packages/numpy/core/__init__.py", line 5, in <module>
import multiarray
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/
lib/python2.6/site-packages/numpy/core/multiarray.so, 2): no suitable
image found. Did find:
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-
packages/numpy/core/multiarray.so: unknown required load command
0x80000022

The file that it claims it can't find a suitable image for does in
fact exist in that directory. I'm stumped.

Funny thing is, when I imported it using python2.5, it worked just
fine. numpy.test(1,10) ran without a hitch.

Thanks for the help. Please redirect me if this question belongs
elsewhere.
 
Reply With Quote
 
 
 
 
Diez B. Roggisch
Guest
Posts: n/a
 
      12-01-2009
Ethos wrote:

> I installed NumPy for python 2.6 on my leopard macbook, using the
> nifty mac installer they now provide. I have the 2.6 official python
> distro installed on my computer, in addition to the 2.5 that is native
> on the mac. When I went to test out the installation, with 2.6, it
> gave me this:
>
>>>> import numpy

> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/numpy/__init__.py", line 132, in <module>
> import add_newdocs
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/numpy/add_newdocs.py", line 9, in <module>
> from lib import add_newdoc
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/numpy/lib/__init__.py", line 4, in <module>
> from type_check import *
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/numpy/lib/type_check.py", line 8, in <module>
> import numpy.core.numeric as _nx
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> python2.6/site-packages/numpy/core/__init__.py", line 5, in <module>
> import multiarray
> ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/
> lib/python2.6/site-packages/numpy/core/multiarray.so, 2): no suitable
> image found. Did find:
> /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-
> packages/numpy/core/multiarray.so: unknown required load command
> 0x80000022
>
> The file that it claims it can't find a suitable image for does in
> fact exist in that directory. I'm stumped.
>
> Funny thing is, when I imported it using python2.5, it worked just
> fine. numpy.test(1,10) ran without a hitch.


Looks like a binary format issue to me. What does


file /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/multiarray.so

give you, and how does it compare to

file /Library/Frameworks/Python.framework/Versions/2.6/bin/python

Maybe you need to strip the binaries to your native arch, using lipo.

Diez
 
Reply With Quote
 
 
 
 
Günther Dietrich
Guest
Posts: n/a
 
      12-01-2009
Ethos <> wrote:

>I installed NumPy for python 2.6 on my leopard macbook, using the
>nifty mac installer they now provide. I have the 2.6 official python
>distro installed on my computer, in addition to the 2.5 that is native
>on the mac. When I went to test out the installation, with 2.6, it
>gave me this:
>
>>>> import numpy

>Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
>python2.6/site-packages/numpy/__init__.py", line 132, in <module>
> import add_newdocs
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
>python2.6/site-packages/numpy/add_newdocs.py", line 9, in <module>
> from lib import add_newdoc
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
>python2.6/site-packages/numpy/lib/__init__.py", line 4, in <module>
> from type_check import *
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
>python2.6/site-packages/numpy/lib/type_check.py", line 8, in <module>
> import numpy.core.numeric as _nx
> File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
>python2.6/site-packages/numpy/core/__init__.py", line 5, in <module>
> import multiarray
>ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/
>lib/python2.6/site-packages/numpy/core/multiarray.so, 2): no suitable
>image found. Did find:
> /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-
>packages/numpy/core/multiarray.so: unknown required load command
>0x80000022


I had the same problem when I tried to use the MacPorts installation of
python3 within blender2.5alpha0 (I pointed the PYTHONPATH to the
respective MacPorts python3 folder). I figured out, that the blender
binary is a 64bit one, but the libraries of the MacPorts python3 are
32bit ones and these two don't fit together.

Then I found out, that -- as opposed to blender 2.4x -- blender 2.5
comes with all the standard python library bundled. So I'm fine with the
pure blender 2.5 for the testing.



Best regards,

Günther
 
Reply With Quote
 
Ethos
Guest
Posts: n/a
 
      12-02-2009
On Dec 1, 3:33*am, "Diez B. Roggisch" <de...@nospam.web.de> wrote:
> Ethos wrote:
> > I installed NumPy for python 2.6 on my leopard macbook, using the
> > nifty mac installer they now provide. I have the 2.6 official python
> > distro installed on my computer, in addition to the 2.5 that is native
> > on the mac. When I went to test out the installation, with 2.6, it
> > gave me this:

>
> >>>> import numpy

> > Traceback (most recent call last):
> > * File "<stdin>", line 1, in <module>
> > * File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> > python2.6/site-packages/numpy/__init__.py", line 132, in <module>
> > * * import add_newdocs
> > * File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> > python2.6/site-packages/numpy/add_newdocs.py", line 9, in <module>
> > * * from lib import add_newdoc
> > * File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> > python2.6/site-packages/numpy/lib/__init__.py", line 4, in <module>
> > * * from type_check import *
> > * File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> > python2.6/site-packages/numpy/lib/type_check.py", line 8, in <module>
> > * * import numpy.core.numeric as _nx
> > * File "/Library/Frameworks/Python.framework/Versions/2.6/lib/
> > python2.6/site-packages/numpy/core/__init__.py", line 5, in <module>
> > * * import multiarray
> > ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/
> > lib/python2.6/site-packages/numpy/core/multiarray.so, 2): no suitable
> > image found. *Did find:
> > /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-
> > packages/numpy/core/multiarray.so: unknown required load command
> > 0x80000022

>
> > The file that it claims it can't find a suitable image for does in
> > fact exist in that directory. I'm stumped.

>
> > Funny thing is, when I imported it using python2.5, it worked just
> > fine. numpy.test(1,10) ran without a hitch.

>
> Looks like a binary format issue to me. What does
>
> file /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/multiarray.so
>
> give you, and how does it compare to
>
> file /Library/Frameworks/Python.framework/Versions/2.6/bin/python
>
> Maybe you need to strip the binaries to your native arch, using lipo.
>
> Diez


I reinstalled numpy, from sourceforge, even though I had already
installed the latest version. Same business. 2.5 imports fine, 2.6
doesn't.

Here's the output of the commands you gave me.

d166-54-tercero-infill-a-1:~ kevin$ file /Library/Frameworks/
Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/
multiarray.so
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-
packages/numpy/core/multiarray.so: Mach-O universal binary with 2
architectures
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-
packages/numpy/core/multiarray.so (for architecture ppc7400): Mach-O
bundle ppc
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-
packages/numpy/core/multiarray.so (for architecture i386): Mach-O
bundle i386
d166-54-tercero-infill-a-1:~ kevin$ file /Library/Frameworks/
Python.framework/Versions/2.6/bin/python
/Library/Frameworks/Python.framework/Versions/2.6/bin/python: Mach-O
universal binary with 2 architectures
/Library/Frameworks/Python.framework/Versions/2.6/bin/python (for
architecture ppc): Mach-O executable ppc
/Library/Frameworks/Python.framework/Versions/2.6/bin/python (for
architecture i386): Mach-O executable i386

I don't know if this helps. Thanks for the help everyone.

Kevin
 
Reply With Quote
 
David Cournapeau
Guest
Posts: n/a
 
      12-02-2009
On Wed, Dec 2, 2009 at 11:03 AM, Ethos <> wrote:

>
> I reinstalled numpy, from sourceforge, even though I had already
> installed the latest version. Same business. 2.5 imports fine, 2.6
> doesn't.
>
> Here's the output of the commands you gave me.


Which exact version of mac os x are you using ? (the output of sw_vers
-productVersion
would be fine).

David
 
Reply With Quote
 
Ethos
Guest
Posts: n/a
 
      12-02-2009
On Dec 1, 6:37*pm, David Cournapeau <courn...@gmail.com> wrote:
> On Wed, Dec 2, 2009 at 11:03 AM, Ethos <kevint...@gmail.com> wrote:
>
> > I reinstalled numpy, from sourceforge, even though I had already
> > installed the latest version. Same business. 2.5 imports fine, 2.6
> > doesn't.

>
> > Here's the output of the commands you gave me.

>
> Which exact version of mac os x are you using ? (the output of sw_vers
> -productVersion
> *would be fine).
>
> David


ProductName: Mac OS X
ProductVersion: 10.5.8
BuildVersion: 9L30

Kevin
 
Reply With Quote
 
Alex
Guest
Posts: n/a
 
      12-06-2009
On Dec 1, 7:04*pm, Ethos <kevint...@gmail.com> wrote:
> On Dec 1, 6:37*pm, David Cournapeau <courn...@gmail.com> wrote:
>
> > On Wed, Dec 2, 2009 at 11:03 AM, Ethos <kevint...@gmail.com> wrote:

>
> > > I reinstallednumpy, from sourceforge, even though I had already
> > > installed the latest version. Same business. 2.5 imports fine, 2.6
> > > doesn't.

>
> > > Here's the output of the commands you gave me.

>
> > Which exact version of mac os x are you using ? (the output of sw_vers
> > -productVersion
> > *would be fine).

>
> > David

>
> ProductName: * *Mac OS X
> ProductVersion: 10.5.8
> BuildVersion: * 9L30
>
> Kevin


I am also trying to install numpy 1.4 and observing exactly the same
symptoms as Kevin (unsurprisingly, since it's a very similar
installation: BuildVersion of 10.5.8 is 9L31a, otherwise identical).
I can also reproduce the problem with the 2.5 version of the 1.4 rc1
numpy DMG (with macpython 2.5.4 from python.org -- it refuses to
install using Apple's own 2.5.1). Is there any known-to-work way to
install numpy 1.4 on Mac OS X 10.5.8, and Python either 2.5 or 2.6?
Guess next I'll try building from sources...


Alex
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing numpy over an older numpy Tom Kacvinsky Python 1 06-15-2012 07:15 PM
A More Concise Description of Numpy than the Guide to Numpy? W. eWatson Python 2 11-23-2009 08:58 PM
NumPy Question - numpy.put in multi-dimensional array Bryan.Fodness@gmail.com Python 2 11-13-2007 10:36 PM
numpy migration (also posted to numpy-discussion) Duncan Smith Python 3 04-25-2007 01:36 AM
Trouble with numpy-0.9.4 and numpy-0.9.5 drife Python 1 03-01-2006 05:59 PM



Advertisments