我正在尝试在Linux上安装python-Levenshtein库,但每当我尝试通过以下方式进行安装时:
sudo pip install python-Levenshtein
我遇到了这个错误:
命令 "/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" 在 /tmp/pip-build-LAmG4b/python-Levenshtein 中返回错误代码 1
并且错误代码为:error: command 'gcc' failed with exit status 1。
我正在使用 Debian Linux。
gcc
或构建工具。在终端中输入which gcc
来验证这一点。执行sudo apt-get install build-essential
后再试一次,可以吗? - wkllibpython-dev
?该软件包还需要构建许多绑定C或公开C扩展的Python模块。 - wkl