iis服务器助手广告广告
返回顶部
首页 > 资讯 > 后端开发 > Python >报错: error: subprocess-exited-with-error
  • 113
分享到

报错: error: subprocess-exited-with-error

pythonbeautifulsoupwindows爬虫 2023-09-03 11:09:35 113人浏览 泡泡鱼

Python 官方文档:入门教程 => 点击学习

摘要

目录 报错说明报错翻译猜测原因解决方法结果 报错说明 在cmd下载BeautifulSoup的时候,输入以下命令: pip install BeautifulSoup 出现以下报错:

目录

报错说明

在cmd下载BeautifulSoup的时候,输入以下命令:

pip install BeautifulSoup

出现以下报错:

 error: subprocess-exited-with-error  × python setup.py egg_info did not run successfully.  │ exit code: 1  ╰─> [7 lines of output]      Traceback (most recent call last):        File "", line 2, in <module>        File "", line 34, in <module>        File "C:\Users\Administrator\AppData\Local\Temp\pip-install-pgs6hik1\beautifulsoup_06fde544331044f484b06f853e2c9761\setup.py", line 3          "You're trying to run a very old release of Beautiful Soup under Python 3. This will not work."<>"Please use Beautiful Soup 4, available through the pip package 'beautifulsoup4'."                      ^      SyntaxError: invalid syntax      [end of output]  note: This error originates from a subprocess, and is likely not a problem with pip.error: metadata-generation-failed× Encountered error while generating package metadata.╰─> See above for output.note: This is an issue with the package mentioned above, not pip.hint: See above for details.C:\Users\Administrator\AppData\Local\Programs\Python\python38>

报错翻译

错误:子进程退出,出现错误×python setup.py egg_info未成功运行。│ 退出代码:1╰─> [7行输出]回溯(最近一次调用):文件“<string>”,第2行,在<module>中文件“<pip setuptools caller>”,第34行,在<module>中文件“C:\Users\Administrator\AppData\Local\Temp\pip-install-pgs6hik1\beautuloup_06fde544331044f484b06f853e2c9761\setup.py”,第3行“您正在尝试在Python 3下运行一个非常旧的Beautiful Soup版本。这行不通。“<>”请使用Beautiful Soup 4,可通过pip包“Beautiful oup4”获得。"^语法错误:无效语法[输出结束]注意:此错误源自子流程,可能不是pip的问题。错误:元数据生成失败×生成包元数据时遇到错误。╰─> 输出见上文。注意:这是上面提到的包的问题,而不是pip。提示:详见上文。

猜测原因

版本不兼容

BeautifulSoup目前适用版本是4.x,前面的版本已停止开发

解决方法

  1. 网上查到的,卸载setuptools,重新安装,别的文章有提到,不再赘述
  2. 下载适应版本的第三方库
 pip install BeautifulSoup4

结果

Collecting beautifulsoup4   Downloading beautifulsoup4-4.11.1-py3-none-any.whl (128 kB)     ---------------------------------------- 128.2/128.2 kB 137.1 kB/s eta 0:00:00Collecting soupsieve>1.2  Downloading soupsieve-2.3.2.post1-py3-none-any.whl (37 kB)Installing collected packages: soupsieve, beautifulsoup4Successfully installed beautifulsoup4-4.11.1 soupsieve-2.3.2.post1

来源地址:https://blog.csdn.net/2301_76257812/article/details/128753181

--结束END--

本文标题: 报错: error: subprocess-exited-with-error

本文链接: https://www.lsjlt.com/news/392102.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作