提出的解决方案: 尝试从系统终端运行此命令。确保使用为位于 'C:\Users\DELL\PycharmProjects\pythonProject\venv\Scripts\python.exe' 处的 Python 解释器安装的正确 'pip' 版本。 命令输出: Collecting BeautifulSoup Using cached BeautifulSoup-3.2.2.tar.gz (32 kB) Using cached BeautifulSoup-3.2.1.tar.gz (31 kB) Using cached BeautifulSoup-3.2.0.tar.gz (31 kB) ERROR: Command errored out with exit status 1: command: 'C:\Users\DELL\PycharmProjects\pythonProject\venv\Scripts\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Windows\\TEMP\\pip-install-f7z6ravn\\beautifulsoup_ecb865e39a574b1d83e590c8eaed4efe\\setup.py'"'"'; __file__='"'"'C:\\Windows\\TEMP\\pip-install-f7z6ravn\\beautifulsoup_ecb865e39a574b1d83e590c8eaed4efe\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Windows\TEMP\pip-pip-egg-info-udzr4vxu' cwd: C:\Windows\TEMP\pip-install-f7z6ravn\beautifulsoup_ecb865e39a574b1d83e590c8eaed4efe\ Complete output (6 lines): Traceback (most recent call last): File "", line 1, in File "C:\Windows\TEMP\pip-install-f7z6ravn\beautifulsoup_ecb865e39a574b1d83e590c8eaed4efe\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 ---------------------------------------- WARNING: Discarding https://files.pythonhosted.org/packages/40/f2/6c9f2f3e696ee6a1fb0e4d7850617e224ed2b0b1e872110abffeca2a09d4/BeautifulSoup-3.2.2.tar.gz#sha256=a04169602bff6e3138b1259dbbf491f5a27f9499dea9a8fbafd48843f9d89970 (from https://pypi.org/simple/beautifulsoup/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. ERROR: Command errored out with exit status 1:
4条回答 默认 最新
- CSDN专家-深度学习进阶 2021-05-14 19:24关注
你可以在cmd中运行pip show beautifulsoup4,找到所在位置删掉它再重新安装
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报