roy-ht/editdistance

unable to install editdistance==0.3.1

Closed this issue · 2 comments

I need 0.3.1 version of editdistance for LipNet, but I'm unable to install it successfully on my Mac. I'm getting following error-

Collecting editdistance==0.3.1
Using cached https://files.pythonhosted.org/packages/a8/08/97ed5b60023ab4b67a46ee24bf1d3db93a9abc5b3be7e8f90de18160aaed/editdistance-0.3.1.tar.gz
Building wheels for collected packages: editdistance
Running setup.py bdist_wheel for editdistance ... error
Complete output from command /Users/riyamaan/anaconda3/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/nm/752rm9hs3lgcn1h8hj2bp5j80000gn/T/pip-install-l24jx647/editdistance/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/nm/752rm9hs3lgcn1h8hj2bp5j80000gn/T/pip-wheel-yalkr6i_ --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-3.6
creating build/lib.macosx-10.7-x86_64-3.6/editdistance
copying editdistance/init.py -> build/lib.macosx-10.7-x86_64-3.6/editdistance
copying editdistance/_editdistance.h -> build/lib.macosx-10.7-x86_64-3.6/editdistance
copying editdistance/def.h -> build/lib.macosx-10.7-x86_64-3.6/editdistance
running build_ext
building 'editdistance.bycython' extension
creating build/temp.macosx-10.7-x86_64-3.6
creating build/temp.macosx-10.7-x86_64-3.6/editdistance
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/riyamaan/anaconda3/include -arch x86_64 -I/Users/riyamaan/anaconda3/include -arch x86_64 -I./editdistance -I/Users/riyamaan/anaconda3/include/python3.6m -c editdistance/_editdistance.cpp -o build/temp.macosx-10.7-x86_64-3.6/editdistance/_editdistance.o
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
editdistance/_editdistance.cpp:16:10: fatal error: 'cstdlib' file not found
#include
^~~~~~~~~
1 warning and 1 error generated.
error: command 'gcc' failed with exit status 1


Failed building wheel for editdistance
Running setup.py clean for editdistance
Failed to build editdistance
Installing collected packages: editdistance
Running setup.py install for editdistance ... error
Complete output from command /Users/riyamaan/anaconda3/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/nm/752rm9hs3lgcn1h8hj2bp5j80000gn/T/pip-install-l24jx647/editdistance/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/nm/752rm9hs3lgcn1h8hj2bp5j80000gn/T/pip-record-tge_t7yr/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
creating build/lib.macosx-10.7-x86_64-3.6/editdistance
copying editdistance/init.py -> build/lib.macosx-10.7-x86_64-3.6/editdistance
copying editdistance/_editdistance.h -> build/lib.macosx-10.7-x86_64-3.6/editdistance
copying editdistance/def.h -> build/lib.macosx-10.7-x86_64-3.6/editdistance
running build_ext
building 'editdistance.bycython' extension
creating build/temp.macosx-10.7-x86_64-3.6
creating build/temp.macosx-10.7-x86_64-3.6/editdistance
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/riyamaan/anaconda3/include -arch x86_64 -I/Users/riyamaan/anaconda3/include -arch x86_64 -I./editdistance -I/Users/riyamaan/anaconda3/include/python3.6m -c editdistance/_editdistance.cpp -o build/temp.macosx-10.7-x86_64-3.6/editdistance/_editdistance.o
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
editdistance/_editdistance.cpp:16:10: fatal error: 'cstdlib' file not found
#include
^~~~~~~~~
1 warning and 1 error generated.
error: command 'gcc' failed with exit status 1

Can you please inform me how to resolve it?

aflc commented

You may need to install gcc and glibc.

conda install -c anaconda gcc glibc

or

conda install -c quantstack gcc-7 libgcc-7

I already had gcc installed on my system.

Used latest version of edit distance instead, it works fine with LipNet.