2024-10-03 02:48:02 发布
网友
我试图安装fastclusterPython库,但遇到了编译错误。在
fastcluster
$ pip install fastcluster
生成以下输出:
是什么原因造成的?关于设置include目录的事情?在
安装fastcluster时遇到的问题与this previous question有关-编译器没有在正确的目录中查找numpy头。您可以或多或少地使用与接受答案中给出的相同的解决方案:
下载并解压fastcluster的源代码
$ pip install fastcluster download='.' $ tar -xzf fastcluster-1.1.17.tar.gz $ cd fastcluster-1.1.17/
编辑setup.py文件,将numpy.get_include()的输出添加到Extension的include_dirs=参数:
setup.py
numpy.get_include()
Extension
include_dirs=
import numpy ... ext_modules=[Extension('_fastcluster', ['src/fastcluster_python.cpp'], extra_compile_args=['/EHsc'] if os.name=='nt' else [], include_dirs=[numpy.get_include()] )]
安装fastcluster:
$ python setup.py install
让^{} maintainer知道他的包裹坏了:-)
安装
fastcluster
时遇到的问题与this previous question有关-编译器没有在正确的目录中查找numpy头。您可以或多或少地使用与接受答案中给出的相同的解决方案:下载并解压
fastcluster
的源代码编辑
setup.py
文件,将numpy.get_include()
的输出添加到Extension
的include_dirs=
参数:安装
fastcluster
:让^{} maintainer 知道他的包裹坏了:-)
相关问题 更多 >
编程相关推荐