我试图根据本指南安装 OpenFST Python 扩展。这样做有两种选择。
第一个选项是--enable-python
在配置 OpenFst 期间发布,我尝试过但失败了。
所以我选择了第二个选项。我使用以下命令成功安装了 OpenFST:
./configure --enable-far
make
sudo make install
然后我尝试openfst
使用pip
:安装 PyPi 包
pip install openfst
并收到以下错误:
Collecting openfst
Using cached https://files.pythonhosted.org/packages/cc/6b/cc05392480e2232e176be895b9ca2b9f4a5f153f99ab276b37d440b3bace/openfst-1.6.6.tar.gz
Building wheels for collected packages: openfst
Running setup.py bdist_wheel for openfst ... error
Complete output from command /home/arif/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-7y6dl6o2/openfst/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-zadciiwk --python-tag cp36:
running bdist_wheel
running build
running build_ext
building 'pywrapfst' extension
creating build
creating build/temp.linux-x86_64-3.6
gcc -pthread -B /home/arif/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/arif/anaconda3/include/python3.6m -c pywrapfst.cc -o build/temp.linux-x86_64-3.6/pywrapfst.o -std=c++11 -Wno-unneeded-internal-declaration -Wno-unused-function
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
pywrapfst.cc:557:40: fatal error: fst/extensions/far/getters.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Failed building wheel for openfst
Running setup.py clean for openfst
Failed to build openfst
Installing collected packages: openfst
Running setup.py install for openfst ... error
Complete output from command /home/arif/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-7y6dl6o2/openfst/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-3niypfz6/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'pywrapfst' extension
creating build
creating build/temp.linux-x86_64-3.6
gcc -pthread -B /home/arif/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/arif/anaconda3/include/python3.6m -c pywrapfst.cc -o build/temp.linux-x86_64-3.6/pywrapfst.o -std=c++11 -Wno-unneeded-internal-declaration -Wno-unused-function
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
pywrapfst.cc:557:40: fatal error: fst/extensions/far/getters.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/home/arif/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-7y6dl6o2/openfst/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-3niypfz6/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-7y6dl6o2/openfst/
谁能帮我解决这个问题?
我正在使用python 3.6 (anaconda)
和OpenFST-1.5.4
在Linux Mint 18.3
.