【问题标题】:How can I install ggplot on Python (Rodeo/Spyder)?如何在 Python (Rodeo/Spyder) 上安装 ggplot?
【发布时间】:2017-11-16 13:45:00
【问题描述】:

我已经尝试在Rodeo 上安装 ggplot 有一段时间了。 我阅读了一些主题,例如Installing ggplot for python failed with error code 1pip install numpy (python 2.7) fails with errorcode 1Error while installing ggplot in python。他们都没有解决我的问题(这可能要简单得多,但我找不到答案)。

我也遵循了https://pypi.python.org/pypi/ggplot 的指导方针。效果也不好。

我不断收到以下错误:

pip install -U ggplot

SyntaxError: 无效语法(,第 1 行)

文件“”,第 1 行

pip install git+https://github.com/yhat/ggplot.git

         ^

SyntaxError: 无效语法

还会发生的是:

将 ggplot 导入为 ggplot

ImportError: 没有名为“ggplot”的模块


ImportError Traceback(最近一次调用)

in ()

----> 1 将ggplot导入为ggplot

ImportError: 没有名为“ggplot”的模块

我尝试使用 Spyder,但得到的消息是“以下命令必须在 IPython shell 之外运行:”。

我错过了什么?如何在 Rodeo 上使用 ggplot?或者至少在 Spyder 上?

【问题讨论】:

    标签: python module installation anaconda rodeo


    【解决方案1】:

    在 rodeo 或 spyder python 中,我使用了以下代码:

    import pip
    pip.main(['install','ggplot'])
    from ggplot import *
    

    【讨论】:

      猜你喜欢
      • 2017-04-06
      • 2015-11-03
      • 2013-05-06
      • 2013-12-19
      • 2020-11-16
      • 2018-11-28
      • 2023-03-05
      • 2015-07-13
      • 1970-01-01
      相关资源
      最近更新 更多