News from this site

 Rental advertising space, please contact the webmaster if you need cooperation


+focus
focused

classification  

no classification

tag  

no tag

date  

no datas

已解决error: subprocess-exited-with-error

posted on 2023-05-21 16:12     read(868)     comment(0)     like(29)     collect(2)


已解决(pip安装第三方模块lxml模块报错)Building wheels for collected packages: lxml
Building wheel for lxml (setup.py) … error
error: subprocess-exited-with-error
python setup.py bdist_wheel did not run successfully.
note: This error originates from a subprocess,and is likely not a problem with pip.
ERROR: Failed building wheel for lxml
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.> lxml
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure









Error report



A friend in the fan group wanted to use pip to install the lxml module, but an error occurred (at that time, he felt a big chill in his heart, and came to me for help, and then successfully helped him solve it. By the way, I will record it and hope it can help more If you encounter this bug and will not solve it), the error code is as follows:

pip install lxml

The screenshot of the error message is as follows :

insert image description here

insert image description here



error translation



The translation of the error message is as follows:

Building wheels for collected packages: lxml
building wheels for lxml (setup.py ... ERROR
: subprocess exited with error
python setup.py bdist_wheel did not run successfully.
Note: this error originates from subprocess and may not be an issue with pip.
ERROR: Failed to generate wheels for lxml
Note: This error originates from subprocess and may not be an issue with pip.
ERROR: Legacy-install-failed
An error was encountered while trying to install the package. > lxml file
Note: This is the package mentioned above , not pip.
Hint: see above for failed output



Error reason



Reason for error :

Some dependent modules are missing, so the installation reports an error.Friends who report errors after installing other third-party modules can also use the following solutions to choose one of them! ! !



Solution 1


  • distutils : distutils is the installer responsible for building third-party Python libraries in the standard library. It can be used to install and publish Python modules. distutils is useful for simple distributions, but lacks functionality.
  • setuptools:setuptools 是 distutils 增强版,不包括在标准库中。其扩展了很多功能,能够帮助开发者更好的创建和分发 Python 包。大部分 Python 用户都会使用更先进的 setuptools 模块。


(1)安装setuptools:

pip install --upgrade setuptools

(2)安装微软的VS Install,把你的操作系统包和改装的库装上:

pip install nes-py --no-cache-dir
pip install --upgrade pip setuptools wheel

(3)然后再次安装lxml模块试试:

pip install lxml


解决方法2(适用于所有模块安装)


注意:此方法适用于所有第三方模块的安装,小伙伴们修改包名即可!!!

报错“ERROR: Failed building wheel for xxx(某个库),这个报错信息表明缺少了相应的 .whl 文件:

insert image description here

(1)下python版本对应.whl文件,下载地址https://pypi.org/

(2)搜索包名(想安装什么模块就搜自己需要的):


insert image description here

(3)找到对应版本然后点击:


insert image description here

(4) 点击下载


insert image description here

(5)下载对应whl文件(cp38:python版本是3.8,amd64:电脑window64位,注意:一定要下载自己电脑和Python的对应版本!


insert image description here

(6)找到文件下面的路径,执行安装命令(我的whl文件放在E盘下,后面是包所在路径和包名):

pip install E:\lxml-4.9.2-cp38-cp38-win_amd64.whl  

(7)安装成功:
insert image description here


以上是此问题报错原因的解决方法,欢迎评论区留言讨论是否能解决,如果有用欢迎点赞收藏文章谢谢支持,博主才有动力持续记录遇到的问题!!!

千人全栈VIP答疑群联系博主帮忙解决报错

Due to the limited time and energy of bloggers, there are too many private messages every day, and there is no way for every fan to reply in time, so reply to VIP fans first, and you can enter the thousand-person full stack by subscribing to the time-limited 9.9 paid column "100 Days Mastering Python from Getting Started to Employment" VIP answering group, get priority answering opportunities (code guidance, remote service), free prostitution 80G learning materials spree, column subscription address: https://blog.csdn.net/yuan2019035055/category_11466020.html

  • Advantages :The author gives priority to answering opportunities (code guidance, remote service), and many bigwigs in the group can hold together to keep warm (big factory internal promotion opportunities). This column is a complete set of teaching specially prepared for students with zero foundation and those who need advanced improvement , From 0 to 100, continue to advance and deepen, and there will be practical projects in the follow-up, so you can easily deal with interviews!

  • Column benefits :Resume guidance, internal referral for recruitment, weekly delivery of physical books, 80G full-stack learning videos, 300 IT e-books: Python, Java, front-end, big data, database, algorithm, crawler, data analysis, machine learning, interview question bank, etc.

  • Note : If you want to get a timely reply, communicate and learn with the big guys, after subscribing to the column, private message the blogger to enter the VIP Q&A group with thousands of peopleinsert image description here
    insert image description here

Free information acquisition, more fan benefits, follow the official account below to obtain

insert image description here



Category of website: technical article > Blog

Author:python98k

link:http://www.pythonblackhole.com/blog/article/25244/15b6dd23c86cf1cfe9fb/

source:python black hole net

Please indicate the source for any form of reprinting. If any infringement is discovered, it will be held legally responsible.

29 0
collect article
collected

Comment content: (supports up to 255 characters)