问题: 在 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 编译器集合)。
解决方法:
立即学习“Python免费学习笔记(深入)”;
使用 yum 安装 gcc:
yum install gcc
安装 gcc 后,重新安装 python levenshtein 库:
pip install python-Levenshtein
以上就是Linux 上安装 Python Levenshtein 库遇到错误:缺少 GCC 依赖项,如何解决?的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号