gpt4 book ai didi

python - 如何为 python 包 bintrees 安装 C 函数?

转载 作者:行者123 更新时间:2023-11-30 15:18:58 25 4
gpt4 key购买 nike

我想使用 python 包 bintrees: https://pypi.python.org/pypi/bintrees/2.0.2

我通过pip将其安装在我的centos上:pip 安装 bintrees

当我在 python 中导入二叉树时,我收到了这些警告:

import bintrees Warning: FastBinaryTree not available, using Python version BinaryTree. Warning: FastAVLTree not available, using Python version AVLTree. Warning: FastRBTree not available, using Python version RBTree.

我想使用FastRBTree,但我不知道如何安装它。在 bintrees 的主页上,我看到了这个:

编译快速树需要 Cython,而在 Windows 上则需要 C 编译器(MingW 工作正常)。

但没有关于如何安装快速树(C 函数)的其他提示。

有人可以告诉我如何安装 bintrees 包的 C 功能吗?

最佳答案

正如您已经说过的,您需要 Cython。

在 CentOS 上你可以这样做

pip install cython

然后重新安装 bintrees:

pip uninstall bintrees
pip install bintrees

关于python - 如何为 python 包 bintrees 安装 C 函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30993528/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com