安装中numpy
+ pandas
通过 setuptools 作为 setup.py 中的依赖项对我不起作用。这与缺少依赖项无关。如果我通过安装 numpypip install numpy
然后python setup.py develop
一切正常。如果我理解的话setuptools
文档正确,所有包都是先构建然后安装的。所以numpy
已构建,但未安装pandas
正在构建。
作为解决方法,我添加了numpy
to my setup_requires
。这工作得很好,但显然不是一个非常干净的解决方案。
有谁知道通过 setuptools 安装 numpy + pandas 的干净解决方案(仅限 Linux 就可以)?
Update:
依赖项是通过配置的
install_requires=['numpy','pandas']
无论我显式添加 numpy 还是仅添加 pandas,这都没有什么区别。在这两种情况下,numpy 都会被下载并构建,但 pandas 无法构建,因为无法找到某些标头(可能在 numpy 的安装步骤中安装,但不是在构建时安装)。如果我先安装 numpy,一切都会正常。我可以 100% 重现此内容,并且与我正在从事的项目无关。
更新2:
这是堆栈跟踪的结尾:
File "/tmp/easy_install-QMa4ce/pandas-0.14.1/temp/easy_install-f6lreI/numpy-1.9.0/numpy/distutils/command/build_src.py", line 153, in run
File "/tmp/easy_install-QMa4ce/pandas-0.14.1/temp/easy_install-f6lreI/numpy-1.9.0/numpy/distutils/command/build_src.py", line 170, in build_sources
File "/tmp/easy_install-QMa4ce/pandas-0.14.1/temp/easy_install-f6lreI/numpy-1.9.0/numpy/distutils/command/build_src.py", line 329, in build_extension_sources
File "/tmp/easy_install-QMa4ce/pandas-0.14.1/temp/easy_install-f6lreI/numpy-1.9.0/numpy/distutils/command/build_src.py", line 386, in generate_sources
File "numpy/core/setup.py", line 432, in generate_config_h
File "numpy/core/setup.py", line 42, in check_types
entry_points={
File "numpy/core/setup.py", line 293, in check_types
SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
最后的消息绝对是错误的。如果我做一个pip install numpy
跑步前python setup.py develop
一切正常。在上面的例子中,我只有pandas
in install_requires
and no numpy
。但据我所知,无论是numpy
是否显式添加。