【问题标题】:ImportError: cannot import name plots. In UBUNTU and WINDOWSImportError:无法导入名称图。在 UBUNTU 和 WINDOWS 中
【发布时间】:2018-10-09 21:16:43
【问题描述】:

我正在处理这个tutorial

只有一行如下:

from getdist import plots, MCSamples

但是python发送错误:

ImportError: cannot import name plots 

我该怎么办?我需要它,但它会发送此错误。

谢谢。

【问题讨论】:

  • 在学习本教程之前,您是否安装了 getdist 模块?
  • @CristiFati 是的,他们在网站的介绍中使用sudo pip install getdist。我给:Requirement already satisfied: getdist in /usr/local/lib/python2.7/dist-packages

标签: python python-2.7 compiler-errors importerror


【解决方案1】:

文件名与模块相似。

getdist.py!!! 我把它改成了gd.py,一切正常。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-02-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多