c++ - Mac OS 上 Pyfasttest 安装失败 : fatal error: 'random' file not found

标签 c++ python-3.x macos cython fasttext

错误消息:
src/pyfasttext.cpp:648:10: fatal error :找不到“随机”文件
#包括 。 ^~~~~~~~ 。 生成 1 个警告和 1 个错误。
错误:命令“gcc”失败,退出状态为 1

<小时/>

已经安装了 gcc 和 LLVM...
UK-xxxx:verheng$ gcc --version
配置为: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM 版本 10.0.0 (clang-1000.10.40.1)
目标:x86_64-apple-darwin17.7.0 线程模型:posix 安装目录:/Library/Developer/CommandLineTools/usr/bin

<小时/>

尝试过这个:https://github.com/vrasneur/pyfasttext/issues/24
没有帮助

谢谢

最佳答案

首先,安装 Cython 以便通过以下命令安装 fasttext:

pip install Cython --install-option="--no-cython-compile"

现在使用以下命令安装 fasttext:

pip install fasttext

关于c++ - Mac OS 上 Pyfasttest 安装失败 : fatal error: 'random' file not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51824905/

相关文章:

c++ - Boost.Python 和 Python 异常

python - NO_CALLBACK 在不应该被调用的情况下被调用

xcode - 开发Mac应用程序时是否可以在不同本地化之间切换?

c++ - 无法将单指针转换为双指针

c++ - 嵌套在 for 语句中的 if 语句将不起作用

c++ - 在桌面图标后面放一个窗口

php - xDebug 似乎安装正常,但无法与 NetBeans 连接

django - 由于 models.DO_NOTHING,FOREIGN KEY 约束失败

python-3.x - Python "if" "and"& "or"之间的条件差异

mysql - 如何在 MAMP 中更改 mySQL root 密码