搜索

首页  >  问答  >  正文

python2.7 - python导入scimath失败提示:cannot import name scimath

运行:

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

求帮助。

高洛峰高洛峰2804 天前883

全部回复(1)我来回复

  • PHP中文网

    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" 前三个搜索结果全部都是相关解决方案, 怎么会搜不到

    回复
    0
  • 取消回复