关于安装BeautifulSoup库的错误提示

在pycharm中安装BeautifulSoup库时提示如下:
Collecting BeautifulSoup
Using cached BeautifulSoup-3.2.2.tar.gz (32 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status ‘error’

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
File ““, line 34, in
File “C:\Users\gx\AppData\Local\Temp\pip-install-180_tdcl\beautifulsoup_e1178a0570914b50a5ddfeaa81ed45bc\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.

[notice] A new release of pip available: 22.3.1 -> 23.1.2
[notice] To update, run: C:\Users\gx\Desktop\Perry老师20230517\venv\Scripts\python.exe -m pip install –upgrade pip


在命令提示符下安装提示如下:

C:\Users\gx>pip install BeautifulSoup
Collecting BeautifulSoup
Using cached BeautifulSoup-3.2.2.tar.gz (32 kB)
Preparing metadata (setup.py) … error
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
File ““, line 34, in
File “C:\Users\gx\AppData\Local\Temp\pip-install-v822vjh3\beautifulsoup_a5dc9e3676c849cc80db2c7395547605\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.


各种网上找资料,升级Pip,卸载python ,重新安装,一直无果,哪位大神出现过类似的情况吗?还望不腻赐教。

最佳答案

Please try using Beautiful Soup 4:

pip install beautifulsoup4
10个月前 评论
ggxxuser (楼主) 10个月前
linkgeek (作者) 10个月前
讨论数量: 4

Please try using Beautiful Soup 4:

pip install beautifulsoup4
10个月前 评论
ggxxuser (楼主) 10个月前
linkgeek (作者) 10个月前

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!