开发构建的pandas给出了importerror:C扩展:'hashtable'不是基于python 3.4(anaconda)构建的

nic*_*_eu 9 python python-3.x pandas

尝试使用3.4进行开发构建(以前在2.7中进行过管理).Python只是osx10.10上的anaconda安装.我可以得到

一世:

  • git克隆熊猫
  • 运行python setup.py build_ext --inplace(没有错误)
  • 运行python setup.py开发.

但是当我尝试导入大熊猫时,我得到:

import pandas as pd
Traceback (most recent call last):

  File "<ipython-input-2-af55e7023913>", line 1, in <module>
    import pandas as pd

  File "/Users/Nick/github/pandas/pandas/__init__.py", line 13, in <module>
    "extensions first.".format(module))

ImportError: C extension: 'hashtable' not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace' to build the C extensions first.
Run Code Online (Sandbox Code Playgroud)

请注意,当我执行build_ext时,我得到以下(显然很好)输出:

pandas(master)$python setup.py build_ext --inplace

running build_ext
skipping 'pandas/index.c' Cython extension (up-to-date)
skipping 'pandas/lib.c' Cython extension (up-to-date)
skipping 'pandas/parser.c' Cython extension (up-to-date)
skipping 'pandas/src/period.c' Cython extension (up-to-date)
skipping 'pandas/hashtable.c' Cython extension (up-to-date)
skipping 'pandas/algos.c' Cython extension (up-to-date)
skipping 'pandas/tslib.c' Cython extension (up-to-date)
skipping 'pandas/src/sparse.c' Cython extension (up-to-date)
skipping 'pandas/src/testing.c' Cython extension (up-to-date)
skipping 'pandas/msgpack.cpp' Cython extension (up-to-date)
Run Code Online (Sandbox Code Playgroud)

此外,如果我运行,我可以安装pandas conda install pandas,但是真的很喜欢代码开发的开发环境.

与此类似,看上去没有解决

nic*_*_eu 8

由于@chrisb的评论,答案就是运行python setup.py build_ext --inplace --force.

  • 我和你一样有同样的问题.我应该在哪里运行这段代码`python setup.py build_ext --inplace --force`?我试图在pandas文件夹中运行它,但它没有找到`setup.py`文件. (12认同)