import failure in python console
at the line: import scipy.io 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/ex8.py", line 27, in <module>
import scipy.io as sio
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/io/__init__.py", 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/__init__.py", 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/mio.py", 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/miobase.py", line 22, in <module>
from scipy.misc import doccer
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/misc/__init__.py", 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/__init__.py", line 546, in <module>
from ._ufuncs import *
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/special/_ufuncs.so, 2): no suitable image found. Did find:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/special/_ufuncs.so: 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.
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/ex8.py", line 27, in <module>
import scipy.io as sio
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/io/__init__.py", 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/__init__.py", 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/mio.py", 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/miobase.py", line 22, in <module>
from scipy.misc import doccer
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/misc/__init__.py", 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/__init__.py", line 546, in <module>
from ._ufuncs import *
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/special/_ufuncs.so, 2): no suitable image found. Did find:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/special/_ufuncs.so: 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.
请先登录再写评论。
First: switched interpreter to Anaconda. all worked. so, my scipy WAS messed up.
Second: reinstalled scipy into my default Python
all worked.
Sorry.