1

我有EPD 7.1for的学术发行版MacOS 10.6.x,其中有 pandas0.3版本。最新的官方版本是0.5.0所以我虽然我会升级到最新的。

这是我所做的:

  1. zip这里保存了源文件
  2. 执行sudo python setup.py install
  3. 通过执行运行测试nosetests pandas

请记住,我是 python 的新手。任何有关我的安装失败原因的见解将不胜感激。以下是错误的片段。整个日志可以在错误日志中找到

结果:

在 55.011 秒内运行 1498 次测试失败(SKIP=4,errors=91,failures=14)

======================================================================
ERROR: test_generate (test_daterange.TestGeneration)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/pandas/core/tests/test_daterange.py", line 20, in test_generate
    rng2 = list(generate_range(START, END, timeRule='WEEKDAY'))
TypeError: generate_range() got an unexpected keyword argument 'timeRule'

@wesm - 感谢您的快速回复。下次我一定会使用邮件列表。所以我实际上回溯了......安装了官方0.5.0版本并从源代码编译。我收到 3 个错误(见下文)。我运行时没有遇到任何问题sudo python setup.py install

======================================================================
ERROR: testForSeries (pandas.stats.tests.test_ols.TestPanelOLS)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/pandas/stats/tests/test_ols.py", line 472, in testForSeries
    self.series_x, self.series_y)
  File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/pandas/stats/tests/test_ols.py", line 565, in checkForSeries
    reference = ols(y=series_y, x=series_x, **kwds)
  File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/pandas/stats/interface.py", line 133, in ols
    return klass(**kwargs)
  File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/pandas/stats/ols.py", line 36, in __init__
    import scikits.statsmodels.api as sm
ImportError: No module named api

======================================================================
ERROR: testNonPooled (pandas.stats.tests.test_ols.TestPanelOLS)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/pandas/stats/tests/test_ols.py", line 522, in testNonPooled
    self.checkNonPooled(y=self.panel_y, x=self.panel_x)
  File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/pandas/stats/tests/test_ols.py", line 528, in checkNonPooled
    result = ols(y=y, x=x, pool=False, **kwds)
  File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/pandas/stats/interface.py", line 133, in ols
    return klass(**kwargs)
  File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/pandas/stats/plm.py", line 780, in __init__
    nw_overlap=nw_overlap)
  File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/pandas/stats/interface.py", line 133, in ols
    return klass(**kwargs)
  File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/pandas/stats/ols.py", line 36, in __init__
    import scikits.statsmodels.api as sm
ImportError: No module named api

======================================================================
ERROR: test_auto_rolling_window_type (pandas.stats.tests.test_ols.TestPanelOLS)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/pandas/stats/tests/test_ols.py", line 604, in test_auto_rolling_window_type
    window_model = ols(y=y, x=data, window=20, min_periods=10)
  File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/pandas/stats/interface.py", line 133, in ols
    return klass(**kwargs)
  File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/pandas/stats/ols.py", line 521, in __init__
    OLS.__init__(self, y=y, x=x, **self._args)
  File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/pandas/stats/ols.py", line 36, in __init__
    import scikits.statsmodels.api as sm
ImportError: No module named api
4

2 回答 2

1

问这个问题的最佳地点是在邮件列表上(幸运的是,谷歌警报让我马上知道这件事!)。看起来您的安装失败了,它仍在使用 pandas 0.3.0。跑的时候有没有报错python setup.py install?如果您从 git 快照 ( sudo easy_install -U Cython) 构建,您可能需要升级 Cython 安装。如果这不起作用,请尝试对现有的 pandas 安装进行核对:

sudo rm -rf /Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/pandas

并重新安装。PyPI上的 tarball包含预构建的 Cython 源。如果你无论如何都是从源代码构建的,我建议无论如何从 git 的 head 版本构建。我距离发布 pandas 0.6.0 还差几天。

于 2011-11-25T18:51:44.663 回答
1

该问题已通过以下方式解决:

1) 安装 Wes 于 2011 年 11 月 25 日发布的 pandas 0.6.0 版本。

2) 删除与 EPD 7.1(版本 0.2)捆绑在一起的现有 scikits 包,并使用“easy_install -U scikits.statsmodels”安装最新版本。

以上是 Wes 和 pystatsmodel 邮件列表中的人们提出的建议(谢谢大家)。

于 2011-11-26T21:28:53.467 回答