Python学习笔记: pip install 常见错误汇总
2022/4/21 14:14:22
本文主要是介绍Python学习笔记: pip install 常见错误汇总,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
本机环境RHEL8, Python3.9
pip install: 无法安装最新版本的包
在pypi上查看pkg的页面,因为有些pip包的版本对特定的python版本有要求
pip install error: “Python.h: No such file or directory”
src/kerberos.c:18:10: fatal error: Python.h: No such file or directory #include <Python.h> ^~~~~~~~~~ compilation terminated.
Fix
安装python版本对应的devel包, 比如
$ sudo yum install python38-devel # for py38 $ sudo dnf install python39-devel # for py39
pip install error: “ERROR: Can not execute setup.py
”
ERROR: Can not execute `setup.py` since setuptools is not available in the build environment.
Fix: pip install -U setuptools
pip install error: No such file or directory: 'curl-config’
self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib64/python3.9/subprocess.py", line 1821, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'curl-config'
Fix:
dnf what-provides curl-config #输出是libcurl-devel dnf install libcurl-devel
pip install error: “lber.h: No such file or directory”
Modules/common.h:15:10: fatal error: lber.h: No such file or directory #include <lber.h> ^~~~~~~~ compilation terminated. error: command '/usr/bin/gcc' failed with exit code 1 [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for python-ldap Failed to build python-ldap
Fix:
$ rpm -qa |grep openldap openldap-clients-2.4.46-18.el8.x86_64 openldap-2.4.46-18.el8.x86_64 $ sudo dnf install openldap-devel
pip install error: “libxml/xmlreader.h: No such file or directory”
ext/ov_xml_reader.c:20:10: fatal error: libxml/xmlreader.h: No such file or directory #include <libxml/xmlreader.h> ^~~~~~~~~~~~~~~~~~~~ compilation terminated. error: command '/usr/bin/gcc' failed with exit code 1 [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure × Encountered error while trying to install package. ╰─> ovirt-engine-sdk-python
Fix:
$ sudo dnf install install libxml2-devel
这篇关于Python学习笔记: pip install 常见错误汇总的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-12-24Python编程入门指南
- 2024-12-24Python编程基础入门
- 2024-12-24Python编程基础:变量与数据类型
- 2024-12-23使用python部署一个usdt合约,部署自己的usdt稳定币
- 2024-12-20Python编程入门指南
- 2024-12-20Python编程基础与进阶
- 2024-12-19Python基础编程教程
- 2024-12-19python 文件的后缀名是什么 怎么运行一个python文件?-icode9专业技术文章分享
- 2024-12-19使用python 把docx转为pdf文件有哪些方法?-icode9专业技术文章分享
- 2024-12-19python怎么更换换pip的源镜像?-icode9专业技术文章分享