首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在Mac OS X Yosemite上安装openfst python库

无法在Mac OS X Yosemite上安装openfst python库
EN

Stack Overflow用户
提问于 2015-12-09 02:13:58
回答 1查看 1.5K关注 0票数 5

上周我一直在尝试安装openfst python库,但是我被卡住了。我已经在stack overflow和其他网站上阅读了所有类似的问题,但没有一个说明有效。我安装了最新的Xcode,使用

代码语言:javascript
复制
brew install openfst

我也安装了openfst,但是当我想要通过以下代码安装python库时:

代码语言:javascript
复制
pip install openfst

在终端中,我得到:

代码语言:javascript
复制
Collecting openfst
  Using cached openfst-1.5.0.tar.gz
Building wheels for collected packages: openfst
  Running setup.py bdist_wheel for openfst
  Complete output from command /Users/ali/anaconda/bin/python -c "import setuptools;__file__='/private/var/folders/36/0m4j84pd49l55mvcqmbqt3z00000gn/T/pip-build-Jqe8Nu/openfst/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /var/folders/36/0m4j84pd49l55mvcqmbqt3z00000gn/T/tmpFNyllkpip-wheel-:
  running bdist_wheel
  running build
  running build_ext
  building 'fst' extension
  creating build
  creating build/temp.macosx-10.5-x86_64-2.7
  gcc -fno-strict-aliasing -I/Users/ali/anaconda/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/ali/anaconda/include/python2.7 -c fst.cc -o build/temp.macosx-10.5-x86_64-2.7/fst.o -std=c++11 -Wno-unneeded-internal-declaration -Wno-unused-function
  In file included from fst.cc:241:
  /usr/local/include/fst/util.h:24:10: fatal error: 'unordered_map' file not found
  #include <unordered_map>
           ^
  1 error generated.
  error: command 'gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for openfst
Failed to build openfst
Installing collected packages: openfst
  Running setup.py install for openfst
    Complete output from command /Users/ali/anaconda/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/36/0m4j84pd49l55mvcqmbqt3z00000gn/T/pip-build-Jqe8Nu/openfst/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/36/0m4j84pd49l55mvcqmbqt3z00000gn/T/pip-oi7XrR-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'fst' extension
    gcc -fno-strict-aliasing -I/Users/ali/anaconda/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/ali/anaconda/include/python2.7 -c fst.cc -o build/temp.macosx-10.5-x86_64-2.7/fst.o -std=c++11 -Wno-unneeded-internal-declaration -Wno-unused-function
    In file included from fst.cc:241:
    /usr/local/include/fst/util.h:24:10: fatal error: 'unordered_map' file not found
    #include <unordered_map>
             ^
    1 error generated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/Users/ali/anaconda/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/36/0m4j84pd49l55mvcqmbqt3z00000gn/T/pip-build-Jqe8Nu/openfst/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/36/0m4j84pd49l55mvcqmbqt3z00000gn/T/pip-oi7XrR-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/36/0m4j84pd49l55mvcqmbqt3z00000gn/T/pip-build-Jqe8Nu/openfst

谁能帮帮我?

EN

回答 1

Stack Overflow用户

发布于 2016-07-23 14:15:05

我建议在启用Python的情况下从源代码编译OpenFST。这很简单:

代码语言:javascript
复制
wget http://www.openfst.org/twiki/pub/FST/FstDownload/openfst-1.7.2.tar.gz
tar zxvf openfst-1.7.2.tar.gz
cd openfst-1.7.2
./configure --enable-python
make
sudo make install
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34163050

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档