python-Levenshtein icon indicating copy to clipboard operation
python-Levenshtein copied to clipboard

GCC build fail when installing using pip install --user in Jupyter

Open DruidSmith opened this issue 8 years ago • 2 comments

Doesn't matter whether using Python 2 or 3 kernels, trying to install via --user parameter results in build fail. Probably trying to write to folders that it shouldn't?

%%sh pip install python-levenshtein --user

Collecting python-levenshtein Using cached python-Levenshtein-0.12.0.tar.gz Requirement already satisfied (use --upgrade to upgrade): setuptools in /opt/anaconda3/lib/python3.5/site-packages/setuptools-20.3-py3.5.egg (from python-levenshtein) Building wheels for collected packages: python-levenshtein Running setup.py bdist_wheel for python-levenshtein: started Running setup.py bdist_wheel for python-levenshtein: finished with status 'error' Complete output from command /opt/anaconda3/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-5jt1oaaa/python-levenshtein/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" bdist_wheel -d /tmp/tmpl_1pzegxpip-wheel- --python-tag cp35: running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.5 creating build/lib.linux-x86_64-3.5/Levenshtein copying Levenshtein/init.py -> build/lib.linux-x86_64-3.5/Levenshtein copying Levenshtein/StringMatcher.py -> build/lib.linux-x86_64-3.5/Levenshtein running egg_info writing top-level names to python_Levenshtein.egg-info/top_level.txt writing requirements to python_Levenshtein.egg-info/requires.txt writing entry points to python_Levenshtein.egg-info/entry_points.txt writing python_Levenshtein.egg-info/PKG-INFO writing dependency_links to python_Levenshtein.egg-info/dependency_links.txt writing namespace_packages to python_Levenshtein.egg-info/namespace_packages.txt warning: manifest_maker: standard file '-c' not found

reading manifest file 'python_Levenshtein.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files matching '_pyc' found anywhere in distribution warning: no previously-included files matching '_so' found anywhere in distribution warning: no previously-included files matching '.project' found anywhere in distribution warning: no previously-included files matching '.pydevproject' found anywhere in distribution writing manifest file 'python_Levenshtein.egg-info/SOURCES.txt' copying Levenshtein/_levenshtein.c -> build/lib.linux-x86_64-3.5/Levenshtein copying Levenshtein/_levenshtein.h -> build/lib.linux-x86_64-3.5/Levenshtein running build_ext building 'Levenshtein._levenshtein' extension creating build/temp.linux-x86_64-3.5 creating build/temp.linux-x86_64-3.5/Levenshtein gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/opt/anaconda3/include/python3.5m -c Levenshtein/_levenshtein.c -o build/temp.linux-x86_64-3.5/Levenshtein/_levenshtein.o unable to execute 'gcc': No such file or directory error: command 'gcc' failed with exit status 1


Running setup.py clean for python-levenshtein Failed to build python-levenshtein Installing collected packages: python-levenshtein Running setup.py install for python-levenshtein: started Running setup.py install for python-levenshtein: finished with status 'error' Complete output from command /opt/anaconda3/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-5jt1oaaa/python-levenshtein/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-x_496f1q-record/install-record.txt --single-version-externally-managed --compile --user --prefix=: running install running build running build_py creating build creating build/lib.linux-x86_64-3.5 creating build/lib.linux-x86_64-3.5/Levenshtein copying Levenshtein/init.py -> build/lib.linux-x86_64-3.5/Levenshtein copying Levenshtein/StringMatcher.py -> build/lib.linux-x86_64-3.5/Levenshtein running egg_info writing python_Levenshtein.egg-info/PKG-INFO writing top-level names to python_Levenshtein.egg-info/top_level.txt writing dependency_links to python_Levenshtein.egg-info/dependency_links.txt writing namespace_packages to python_Levenshtein.egg-info/namespace_packages.txt writing entry points to python_Levenshtein.egg-info/entry_points.txt writing requirements to python_Levenshtein.egg-info/requires.txt warning: manifest_maker: standard file '-c' not found

reading manifest file 'python_Levenshtein.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*pyc' found anywhere in distribution
warning: no previously-included files matching '*so' found anywhere in distribution
warning: no previously-included files matching '.project' found anywhere in distribution
warning: no previously-included files matching '.pydevproject' found anywhere in distribution
writing manifest file 'python_Levenshtein.egg-info/SOURCES.txt'
copying Levenshtein/_levenshtein.c -> build/lib.linux-x86_64-3.5/Levenshtein
copying Levenshtein/_levenshtein.h -> build/lib.linux-x86_64-3.5/Levenshtein
running build_ext
building 'Levenshtein._levenshtein' extension
creating build/temp.linux-x86_64-3.5
creating build/temp.linux-x86_64-3.5/Levenshtein
gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/opt/anaconda3/include/python3.5m -c Levenshtein/_levenshtein.c -o build/temp.linux-x86_64-3.5/Levenshtein/_levenshtein.o
unable to execute 'gcc': No such file or directory
error: command 'gcc' failed with exit status 1

----------------------------------------

Failed building wheel for python-levenshtein Command "/opt/anaconda3/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-5jt1oaaa/python-levenshtein/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-x_496f1q-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-5jt1oaaa/python-levenshtein/

DruidSmith avatar Aug 09 '16 21:08 DruidSmith

It says very clearly that gcc (the C compiler) is not installed. This library doesn't have a pure-python wrapper, just a bare C library for speed without pure python backing. A C compiler is required to install this from source. However, I could provide a manylinux wheel automatically

ztane avatar Aug 10 '16 05:08 ztane

Including a wheel would be hugely helpful - I'm running in a shared Jupyter Hub environment where I don't necessarily have permissions or control over the underlying infrastructure and have to install modules locally (pip install --user)

DruidSmith avatar Aug 10 '16 14:08 DruidSmith