import failure in python console

at the line:  import as sio

when I run the python file in the console (ipython turned off), the following error occurs:

Traceback (most recent call last):
  File "/Users/lewislevin/Dropbox/Online Coursework/Stanford Machine Learning/Assignments/Python-ex8/", line 27, in <module>
    import as sio
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/io/", line 85, in <module>
    from .matlab import loadmat, savemat, whosmat, byteordercodes
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/io/matlab/", line 13, in <module>
    from .mio import loadmat, savemat, whosmat
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/io/matlab/", line 12, in <module>
    from .miobase import get_matfile_version, docfiller
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/io/matlab/", line 22, in <module>
    from scipy.misc import doccer
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/misc/", line 47, in <module>
    from scipy.special import comb, factorial, factorial2, factorialk
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/special/", line 546, in <module>
    from ._ufuncs import *
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/special/, 2): no suitable image found.  Did find:
    /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/special/ mach-o, but wrong architecture

"It" (not sure if it is Python or PyCharm) thinks that the executable file is the wrong architecture.  My Python 2.8.8 is x86_64 as are all of the modules, including scipy, which were installed with pip after Python.

When I run this exact same file in a standalone Python (open a terminal on the project directory, start python) the code works with no problems.

Something funky going on with the PyCharm console.
1 comment
Comment actions Permalink

First:  switched interpreter to Anaconda.  all worked.  so, my scipy WAS messed up.

Second:  reinstalled scipy into my default Python

all worked.


Please sign in to leave a comment.