运行:
from numpy import *
显示:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\numpy\__init__.py", line 170, in <module>
from . import add_newdocs
File "C:\Python27\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "C:\Python27\lib\site-packages\numpy\lib\__init__.py", line 17, in <module>
from . import scimath as emath
ImportError: cannot import name scimath
求帮助。
PHP中文网2017-04-17 17:09:52
錯誤出在這裡, from .
是相對路徑, 顯然你的 python 沒設定好.
from . import scimath as emath
最簡單的就是用安裝一個anaconda發行版的 python, 別再自己折騰了, 數值計算那幾個package 安裝麻煩的很, 小毛病一堆, 而且windows估計更麻煩.
PS: 學會怎麼搜尋, http://stackoverflow.com/questions/26238004/ipython-notebook-throws-importerror-ipython-doesnt. 關鍵字"cannot import name scimath" 前三個搜尋結果全部都是相關解決方案, 怎麼會搜不到