sudo pip install python-Levenshtein failed with error code 1
Question: I'm trying to install the python-Levenshtein library on linux, but whenever I
try to install it via:

    
    
    sudo pip install python-Levenshtein
    

I get this error:

> Command "/usr/bin/python -c "import setuptools, tokenize;**file**
> ='/tmp/pip-build-LAmG4b/python-
> Levenshtein/setup.py';exec(compile(getattr(tokenize, 'open',
> open)(**file**).read().replace('\r\n', '\n'), **file** , 'exec'))" install
> --record /tmp/pip-KGiQPH-record/install-record.txt --single-version-
> externally-managed --compile" failed with error code 1 in /tmp/pip-build-
> LAmG4b/python-Levenshtein

And the error code: error: command 'gcc' failed with exit status 1

I'm using debian linux.


Answer: One of the `python-Levenshtein` maintainers here.

Make sure you have `python-dev` and `build-essential` packages.

Are you sure that's full error message as the actual error seem to be missing?

If a log file is created can you peek into it and add its content to the
question.

Also read the official Python package installation guide. [Use virtual
environments](https://packaging.python.org/en/latest/installing/#creating-
virtual-environments). Never do `sudo pip install` unless you have a specific
reason to do so.

