I'm trying to install FuzzySet in my virtualenv:
(virtualenv) machine:user$ pip install FuzzySet
and I got this error:
(virtualenv) machine:user$ pip install FuzzySet
Collecting FuzzySet
Using cached fuzzyset-0.0.11.tar.gz
Requirement already satisfied: python-levenshtein in /Users/dedeco/Envs/Craw/lib/python3.6/site-packages (from FuzzySet)
Requirement already satisfied: texttable in /Users/dedeco/Envs/Craw/lib/python3.6/site-packages (from FuzzySet)
Requirement already satisfied: setuptools in /Users/dedeco/Envs/Craw/lib/python3.6/site-packages (from python-levenshtein->FuzzySet)
Building wheels for collected packages: FuzzySet
Running setup.py bdist_wheel for FuzzySet ... error
Complete output from command /Users/dedeco/Envs/Craw/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/y7/1vddc8q51zq_q_dc0gw581480000gn/T/pip-build-1e0boni3/FuzzySet/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 /var/folders/y7/1vddc8q51zq_q_dc0gw581480000gn/T/tmpbguw98h6pip-wheel- --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.12-x86_64-3.6
creating build/lib.macosx-10.12-x86_64-3.6/fuzzyset
copying fuzzyset/__init__.py -> build/lib.macosx-10.12-x86_64-3.6/fuzzyset
running build_ext
building 'cfuzzyset' extension
creating build/temp.macosx-10.12-x86_64-3.6
creating build/temp.macosx-10.12-x86_64-3.6/fuzzyset
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -I/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c fuzzyset/cfuzzyset.c -o build/temp.macosx-10.12-x86_64-3.6/fuzzyset/cfuzzyset.o
clang: error: no such file or directory: 'fuzzyset/cfuzzyset.c'
clang: error: no input files
error: command 'clang' failed with exit status 1
----------------------------------------
Failed building wheel for FuzzySet
Running setup.py clean for FuzzySet
Failed to build FuzzySet
Installing collected packages: FuzzySet
Running setup.py install for FuzzySet ... error
Complete output from command /Users/dedeco/Envs/Craw/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/y7/1vddc8q51zq_q_dc0gw581480000gn/T/pip-build-1e0boni3/FuzzySet/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/y7/1vddc8q51zq_q_dc0gw581480000gn/T/pip-ku90bpma-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/dedeco/Envs/Craw/bin/../include/site/python3.6/FuzzySet:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.12-x86_64-3.6
creating build/lib.macosx-10.12-x86_64-3.6/fuzzyset
copying fuzzyset/__init__.py -> build/lib.macosx-10.12-x86_64-3.6/fuzzyset
running build_ext
building 'cfuzzyset' extension
creating build/temp.macosx-10.12-x86_64-3.6
creating build/temp.macosx-10.12-x86_64-3.6/fuzzyset
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -I/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c fuzzyset/cfuzzyset.c -o build/temp.macosx-10.12-x86_64-3.6/fuzzyset/cfuzzyset.o
clang: error: no such file or directory: 'fuzzyset/cfuzzyset.c'
clang: error: no input files
error: command 'clang' failed with exit status 1
----------------------------------------
Command "/Users/dedeco/Envs/Craw/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/y7/1vddc8q51zq_q_dc0gw581480000gn/T/pip-build-1e0boni3/FuzzySet/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/y7/1vddc8q51zq_q_dc0gw581480000gn/T/pip-ku90bpma-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/dedeco/Envs/Craw/bin/../include/site/python3.6/FuzzySet" failed with error code 1 in /private/var/folders/y7/1vddc8q51zq_q_dc0gw581480000gn/T/pip-build-1e0boni3/FuzzySet/
Can someone help me? I think that is related a compiler c in my machine, and is not able to compile, but I had installed a lot of things in past without problem.
phd's answer didn't fix it for me. Installing cython manually did the trick:
pip install cython
The fuzzyset package at PyPI lacks the file fuzzyset/cfuzzyset.c. It's a bug in the package, already reported.
Your only chance for now is to install from github:
pip install git+https://github.com/axiak/fuzzyset.git#egg=fuzzyset
Installing fuzzyset after installing cython fixed the problem for me
python -m pip install cython
python -m pip install fuzzyset
I couldn't get !pip install fuzzyset to work either on OS X, python 3.7. But !easy_install fuzzyset worked fine
Related
I am trying to install pyaudio on my system.
System Specification: macOS Mojava
Version: 10.14.2 (18C54)
Error that I am getting is this:
Collecting pyaudio
Using cached https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz
Building wheels for collected packages: pyaudio
Running setup.py bdist_wheel for pyaudio ... error
Complete output from command /Users/dsnanaware/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/r7/64j7w40s1fn8bmdkblq1pbym0000gn/T/pip-install-yro3wf2m/pyaudio/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 /private/var/folders/r7/64j7w40s1fn8bmdkblq1pbym0000gn/T/pip-wheel-3d4sruhv --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-3.6
copying src/pyaudio.py -> build/lib.macosx-10.7-x86_64-3.6
running build_ext
building '_portaudio' extension
creating build/temp.macosx-10.7-x86_64-3.6
creating build/temp.macosx-10.7-x86_64-3.6/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/dsnanaware/anaconda3/include -arch x86_64 -I/Users/dsnanaware/anaconda3/include -arch x86_64 -DMACOSX=1 -I/Users/dsnanaware/anaconda3/include/python3.6m -c src/_portaudiomodule.c -o build/temp.macosx-10.7-x86_64-3.6/src/_portaudiomodule.o
src/_portaudiomodule.c:27:19: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Failed building wheel for pyaudio
Running setup.py clean for pyaudio
Failed to build pyaudio
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
Complete output from command /Users/dsnanaware/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/r7/64j7w40s1fn8bmdkblq1pbym0000gn/T/pip-install-yro3wf2m/pyaudio/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/r7/64j7w40s1fn8bmdkblq1pbym0000gn/T/pip-record-4xqsbegf/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-3.6
copying src/pyaudio.py -> build/lib.macosx-10.7-x86_64-3.6
running build_ext
building '_portaudio' extension
creating build/temp.macosx-10.7-x86_64-3.6
creating build/temp.macosx-10.7-x86_64-3.6/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/dsnanaware/anaconda3/include -arch x86_64 -I/Users/dsnanaware/anaconda3/include -arch x86_64 -DMACOSX=1 -I/Users/dsnanaware/anaconda3/include/python3.6m -c src/_portaudiomodule.c -o build/temp.macosx-10.7-x86_64-3.6/src/_portaudiomodule.o
src/_portaudiomodule.c:27:19: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/Users/dsnanaware/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/r7/64j7w40s1fn8bmdkblq1pbym0000gn/T/pip-install-yro3wf2m/pyaudio/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/r7/64j7w40s1fn8bmdkblq1pbym0000gn/T/pip-record-4xqsbegf/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/r7/64j7w40s1fn8bmdkblq1pbym0000gn/T/pip-install-yro3wf2m/pyaudio/
Method that I have tried to fix this:
brew install portaudio
pip install pyaudio
But even after trying this I am getting the same error.
Can anyone help me with this error??
Thank You !!
Solution:
brew update
brew install portaudio
brew link --overwrite portaudio
pip install pyaudio
https://medium.com/#moon_is_beautiful/when-cant-install-pyaudio-with-pip-190973840dbf
For me, it worked following this Gist
https://gist.github.com/jiaaro/9767512210a1d80a8a0d
Install portaudio using homebrew (or method of your choice)
brew install portaudio
create $HOME/.pydistutils.cfg using the include and lib directories of your portaudio install:
[build_ext]
include_dirs=/Users/jrobert1271/homebrew/Cellar/portaudio/19.20140130/include/
library_dirs=/Users/jrobert1271/homebrew/Cellar/portaudio/19.20140130/lib/
Then in your virtualenv:
pip install --global-option='build_ext' --global-option='-I/usr/local/include' --global-option='-L/usr/local/lib' pyaudio
When I tried to install httrack in Ubuntu 16.04 I was not able to get those packages:
pip3 install httrack-py
Collecting httrack-py
Using cached https://files.pythonhosted.org/packages/58/b8/9499cd45ffb4efefff06090f04111c6572e7947eb4485d3333edc9505ed0/httrack-py-0.6.1.tar.gz
Installing collected packages: httrack-py
Running setup.py install for httrack-py ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-96j_4z55/httrack-py/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-f9__5p13-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.5
copying httrack.py -> build/lib.linux-x86_64-3.5
running build_ext
building 'httracklib' extension
creating build/temp.linux-x86_64-3.5
creating build/temp.linux-x86_64-3.5/src
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/build/python3.5-6tVwKN/python3.5-3.5.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/petri/downloads/httrack-source -I/home/petri/downloads/httrack-source/src -I/usr/include -I/usr/include/python3.5 -I/usr/include/python3.5m -c src/httrack-py.c -o build/temp.linux-x86_64-3.5/src/httrack-py.o
src/httrack-py.c:45:29: fatal error: httrack-library.h: No such file or directory
#include "httrack-library.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-96j_4z55/httrack-py/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-f9__5p13-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-96j_4z55/httrack-py/
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Run the code:
sudo apt-get update
And if its not working
Try to update repository in software centre.
The pip log says:
#include "httrack-library.h"
A necessary library header is missing.
Try running sudo apt install libhttrack-dev and then pip install again.
Currently trying to run pip install python-lzo in any environment fails for me (I have tried on three different machines: ubuntu 16.04, macosx and inside a docker container based on python:2.7):
Collecting python-lzo
Downloading python-lzo-1.11.tar.gz
Building wheels for collected packages: python-lzo
Running setup.py bdist_wheel for python-lzo ... error
Complete output from command /usr/local/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/2m/0shxv04j04lcm1c0dddyf4qw0000gn/T/pip-build-iOtvF1/python-lzo/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 /var/folders/2m/0shxv04j04lcm1c0dddyf4qw0000gn/T/tmp4XTk5Ipip-wheel- --python-tag cp27:
/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:251: UserWarning: 'licence' distribution option is deprecated; use 'license'
warnings.warn(msg)
running bdist_wheel
running build
running build_ext
building 'lzo' extension
creating build
creating build/temp.macosx-10.11-x86_64-2.7
clang -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/include/lzo -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c lzomodule.c -o build/temp.macosx-10.11-x86_64-2.7/lzomodule.o
lzomodule.c:35:10: fatal error: 'lzo1x.h' file not found
#include <lzo1x.h>
^
1 error generated.
error: command 'clang' failed with exit status 1
----------------------------------------
Failed building wheel for python-lzo
Running setup.py clean for python-lzo
Failed to build python-lzo
Installing collected packages: python-lzo
Running setup.py install for python-lzo ... error
Complete output from command /usr/local/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/2m/0shxv04j04lcm1c0dddyf4qw0000gn/T/pip-build-iOtvF1/python-lzo/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/2m/0shxv04j04lcm1c0dddyf4qw0000gn/T/pip-iXLv5I-record/install-record.txt --single-version-externally-managed --compile:
/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py:251: UserWarning: 'licence' distribution option is deprecated; use 'license'
warnings.warn(msg)
running install
running build
running build_ext
building 'lzo' extension
creating build
creating build/temp.macosx-10.11-x86_64-2.7
clang -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/include/lzo -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c lzomodule.c -o build/temp.macosx-10.11-x86_64-2.7/lzomodule.o
lzomodule.c:35:10: fatal error: 'lzo1x.h' file not found
#include <lzo1x.h>
^
1 error generated.
error: command 'clang' failed with exit status 1
----------------------------------------
Command "/usr/local/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/2m/0shxv04j04lcm1c0dddyf4qw0000gn/T/pip-build-iOtvF1/python-lzo/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/2m/0shxv04j04lcm1c0dddyf4qw0000gn/T/pip-iXLv5I-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/2m/0shxv04j04lcm1c0dddyf4qw0000gn/T/pip-build-iOtvF1/python-lzo/
Really I am trying to build a docker container that runs this:
RUN pip install python-lzo
Any thoughts here? Thanks!
You must install liblzo2-dev in debian base image and install lzo-devel in centos base image.
Fixed this with the following Dockerfile:
FROM ubuntu:16.04
RUN apt-get update && \
apt-get install -y python python-pip python-lzo zlib1g-dev unzip
RUN pip install bx-python
So apparently you can install python-lzo directly through apt instead of using pip? sigh
I'm using TravisCI to run my unit tests for python 2.7, 3.4, 3.5 and 3.6. My .travis.yml file includes the line - pip install pytest-faulthandler, which until 2 days ago gave me no issues. Then, yesterday, for no apparent reason, this line started causing the Travis build to crash with error:
The command "pip install pytest-faulthandler" failed and exited with 1 during .
This in turn seems to stem from a bad path to gcc (set by anaconda?):
unable to execute 'x86_64-conda_cos6-linux-gnu-gcc': No such file or directory
Detailed error log below. As far as I can tell I haven't changed anything to my configuration (travis.yml, setup.cfg, setup.py) that could influence this. The problem only happens for python 2.7, for 3.4-3.6 travis builds the environment without any issues.
I've tried searching online to see if anyone's experienced/solved this issue already, but no luck. Any suggestions/advice would be most welcome. Thanks!
Travis error log below, the complete build log can be found here.
Collecting pytest-faulthandler
Downloading pytest_faulthandler-1.3.1-py2.py3-none-any.whl
Collecting pytest>=2.6 (from pytest-faulthandler)
Downloading pytest-3.2.2-py2.py3-none-any.whl (187kB)
100% |████████████████████████████████| 194kB 4.7MB/s
Collecting faulthandler; python_version == "2.6" or python_version == "2.7" (from pytest-faulthandler)
Downloading faulthandler-3.0.tar.gz (55kB)
100% |████████████████████████████████| 61kB 8.7MB/s
Requirement already satisfied: setuptools in /home/travis/miniconda/envs/test-environment/lib/python2.7/site-packages (from pytest>=2.6->pytest-faulthandler)
Collecting py>=1.4.33 (from pytest>=2.6->pytest-faulthandler)
Using cached py-1.4.34-py2.py3-none-any.whl
Building wheels for collected packages: faulthandler
Running setup.py bdist_wheel for faulthandler ... error
Complete output from command /home/travis/miniconda/envs/test-environment/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-wI1YGd/faulthandler/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/tmpyGVM8Opip-wheel- --python-tag cp27:
running bdist_wheel
running build
running build_ext
building 'faulthandler' extension
creating build
creating build/temp.linux-x86_64-2.7
x86_64-conda_cos6-linux-gnu-gcc -pthread -fno-strict-aliasing -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O3 -pipe -DNDEBUG -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/travis/miniconda/envs/test-environment/include/python2.7 -c faulthandler.c -o build/temp.linux-x86_64-2.7/faulthandler.o
unable to execute 'x86_64-conda_cos6-linux-gnu-gcc': No such file or directory
error: command 'x86_64-conda_cos6-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for faulthandler
Running setup.py clean for faulthandler
Failed to build faulthandler
Installing collected packages: py, pytest, faulthandler, pytest-faulthandler
Running setup.py install for faulthandler ... error
Complete output from command /home/travis/miniconda/envs/test-environment/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-wI1YGd/faulthandler/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-lKAMMU-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'faulthandler' extension
creating build
creating build/temp.linux-x86_64-2.7
x86_64-conda_cos6-linux-gnu-gcc -pthread -fno-strict-aliasing -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O3 -pipe -DNDEBUG -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/travis/miniconda/envs/test-environment/include/python2.7 -c faulthandler.c -o build/temp.linux-x86_64-2.7/faulthandler.o
unable to execute 'x86_64-conda_cos6-linux-gnu-gcc': No such file or directory
error: command 'x86_64-conda_cos6-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/home/travis/miniconda/envs/test-environment/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-wI1YGd/faulthandler/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-lKAMMU-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-wI1YGd/faulthandler/
The command "pip install pytest-faulthandler" failed and exited with 1 during .
Your build has been stopped.
After additional searching I found this related post, following which I replaced the miniconda version in .travis.yml to Miniconda2-4.3.21-Linux-x86_64.sh for Python 2 and Miniconda3-4.3.21-Linux-x86_64.sh for Python 3, and prevented conda from updating by commenting out - conda update -q conda. This time my environment built correctly for all python versions, problem fixed.
As noted in the linked post, this seems like a bug in the installation script for Anaconda (and miniconda) 4.3.27, and the solution is to use an earlier version (e.g. 4.3.21) and prevent conda from updating.
I have been trying to install openfst python library for the last week, however I am stuck. I have read all similar questions on stack overflow and other websites but none of the instructions work.
I have the latest Xcode installed, using
brew install openfst
I also installed openfst, however when I want to install the python library by writing:
pip install openfst
in the terminal, I get:
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
Could someone please help me?
I would suggest compiling OpenFST from source with Python enabled. It's pretty easy:
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