D:\programfile\Lib\site-packages>pip install BeautifulSoup Collecting BeautifulSoup Using cached BeautifulSoup-3.2.2.tar.gz (32 kB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [23 lines of output] Traceback (most recent call last): File "D:\programfile\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module> main() File "D:\programfile\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\programfile\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel return hook(config_settings) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yzs\AppData\Local\Temp\pip-build-env-urjdrx0y\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=['wheel']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yzs\AppData\Local\Temp\pip-build-env-urjdrx0y\overlay\Lib\site-packages\setuptools\build_meta.py", line 323, in _get_build_requires self.run_setup() File "C:\Users\yzs\AppData\Local\Temp\pip-build-env-urjdrx0y\overlay\Lib\site-packages\setuptools\build_meta.py", line 488, in run_setup self).run_setup(setup_script=setup_script) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yzs\AppData\Local\Temp\pip-build-env-urjdrx0y\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in run_setup exec(code, locals()) File "<string>", 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: subprocess-exited-with-error × Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip. D:\programfile\Lib\site-packages>
时间: 2023-07-31 11:10:11 浏览: 186
Python BeautifulSoup [解决方法] TypeError: list indices must be integers or slices, not str
5星 · 资源好评率100%
这个错误提示显示你正在尝试使用 Python 3 运行一个非常老的版本的 Beautiful Soup。你可以尝试执行以下命令来安装 Beautiful Soup 4:
```
pip install beautifulsoup4
```
这将安装最新版本的 Beautiful Soup,它支持 Python 3。
阅读全文