Linux 上安装 Python Levenshtein 库遇到错误:缺少 GCC 依赖项,如何解决?
对于一个文章开发者来说,牢固扎实的基础是十分重要的,就来带大家一点点的掌握基础知识点。今天本篇文章带大家了解《Linux 上安装 Python Levenshtein 库遇到错误:缺少 GCC 依赖项,如何解决?》,主要介绍了,希望对大家的知识积累有所帮助,快点收藏起来吧,否则需要时就找不到了!
问题: 在 windows 本地计算机上,使用 whl 方式安装 python levenshtein 库成功了,克服了 vc++ 问题。但是,在上载到 linux 服务器后,安装遇到错误。
错误信息:
error: command errored out with exit status 1: command: /yuwei/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-_97ezszt/python-levenshtein/setup.py'"'"'; file='"'"'/tmp/pip-install-_97ezszt/python-levenshtein/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/pip-wheel-cv8p0664 cwd: /tmp/pip-install-_97ezszt/python-levenshtein/
该错误是由于缺少依赖项,即未安装 gcc(gnu 编译器集合)。
解决方法:
使用 yum 安装 gcc:
yum install gcc
安装 gcc 后,重新安装 python levenshtein 库:
pip install python-Levenshtein
文中关于的知识介绍,希望对你的学习有所帮助!若是受益匪浅,那就动动鼠标收藏这篇《Linux 上安装 Python Levenshtein 库遇到错误:缺少 GCC 依赖项,如何解决?》文章吧,也可关注公众号了解相关技术文章。