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: 1775
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: 153
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.
RIP #!
User avatar
Crimson King
 
Posts: 159
Joined: Fri Mar 08, 2013 2:42 pm
Location: Dublin, Ireland

Re: installing numpy and scipy on mac

Postby gronmat » Sun Jun 28, 2015 8:56 am

Hi,

I installed Canopy, but I still get the errors:
Code: Select all
   import numpy
  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



Can anybody help with this?
Last edited by Yoriz on Sun Jun 28, 2015 2:39 pm, edited 1 time in total.
Reason: First post lock, Added code tags.
gronmat
 
Posts: 2
Joined: Sun Jun 28, 2015 8:54 am

Re: installing numpy and scipy on mac

Postby Yoriz » Sun Jun 28, 2015 2:40 pm

Use code tags.
Read the link in my signature.
Don't create new accounts for each post.
New Users, Read This
Join the #python-forum IRC channel on irc.freenode.net!
Image
User avatar
Yoriz
 
Posts: 1399
Joined: Fri Feb 08, 2013 1:35 am
Location: UK

Re: installing numpy and scipy on mac

Postby gronmat » Mon Jun 29, 2015 2:32 am

This is my first account here. I was just searching around for a solution and found this thread.
gronmat
 
Posts: 2
Joined: Sun Jun 28, 2015 8:54 am

Re: installing numpy and scipy on mac

Postby metulburr » Mon Jun 29, 2015 5:04 am

gronmat wrote:This is my first account here


@Yoriz
Their IPs are different.

@gronmat
Do not hijack other peoples threads. If you get an error, please post a new thread with your own details. IF you are following along with the OP's problem and have the same problem, post a new thread and link back to this thread for reference. It just so happens that your question makes it sound like the OP created a new account and responded to Crimson King
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1775
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY


Return to General Coding Help

Who is online

Users browsing this forum: No registered users and 6 guests