installing numpy and scipy on mac

This is the place for queries that don't fit in any of the other categories.

installing numpy and scipy on mac

Postby peegee_2000 » Wed Jul 24, 2013 10:38 pm

Hi!

I am trying to install numpy and scipy on my mac (OS X version 10.6.8). it installed successfully and I got the message installed successfully. When I am tryin to use it it give me error.
Code: Select all
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/__init__.py", line 137, in <module>
    import add_newdocs
  File "/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 "/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 "/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 "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/__init__.py", line 5, in <module>
    import multiarray
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so, 2): no suitable image found.  Did find:
   /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so: no matching architecture in universal wrapper

Code: Select all
>>> import scipy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/__init__.py", line 78, in <module>
    from numpy import show_config as show_numpy_config
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/__init__.py", line 137, in <module>
    import add_newdocs
  File "/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 "/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 "/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 "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/__init__.py", line 5, in <module>
    import multiarray
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so, 2): no suitable image found.  Did find:
   /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/multiarray.so: no matching architecture in universal wrapper


I will really appreciate if somebody can help and explain what I am doing wrong.
Last edited by Yoriz on Wed Jul 24, 2013 10:51 pm, edited 1 time in total.
Reason: Added code tags
peegee_2000
 
Posts: 1
Joined: Wed Jul 24, 2013 10:33 pm

Re: installing numpy and scipy on mac

Postby metulburr » Wed Jul 24, 2013 11:37 pm

no matching architecture in universal wrapper

the keyword being architecture in that error. My first guess would be that you have a 32/64 bit mismatch. Make sure you install the correct architecture 3rd party modules and correct architecture python version with your OS architecture version. AKA if you have a 32 bit OS, you need 32 bit python, 32 bit 3rd party modules, etc.
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1299
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: installing numpy and scipy on mac

Postby tnknepp » Thu Jul 25, 2013 4:55 pm

If you are using numpy/scipy, and you are operating on 64-bit architecture, you will want 64-bit numpy/scipy. These are not readily available in the standard release sources. I recommend using anaconda, which is a package of data analysis tools for python. I have had many problems with packages, when installed separately, not being compatible with each other (honestly, this is VERY likely my fault, but I still prefer having everything in one installation for me). If you are doing heavy data analysis I recommend you look into using pandas, which is included in the anaconda package.
Python: 2.7 via Anaconda
Numpy: 1.7
Pandas: 0.11
OS: Windows 7
IDE: Spyder/IPython
User avatar
tnknepp
 
Posts: 119
Joined: Mon Mar 11, 2013 7:41 pm

Re: installing numpy and scipy on mac

Postby Crimson King » Thu Jul 25, 2013 6:01 pm

You could also install Canopy it comes with an ipython shell and many modules included (i believe numpy, scipy and matplotlib are some of those)

You can find the 32/64 bit Mac version in the page i linked.
User avatar
Crimson King
 
Posts: 85
Joined: Fri Mar 08, 2013 2:42 pm
Location: Buenos Aires, Argentina


Return to General Coding Help

Who is online

Users browsing this forum: No registered users and 3 guests