【pip】pip3安装BeautifulSoup

1、pip install BeautifulSoup报错
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting BeautifulSoup
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/40/f2/6c9f2f3e696ee6a1fb0e4d7850617e224ed2b0b1e872110abffeca2a09d4/BeautifulSoup-3.2.2.tar.gz (32 kB)
ERROR: Command errored out with exit status 1:
command: 'E:\integration_test\venv\Scripts\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-0suiyo62\\beautifulsoup_c20dc2acaa064097abdc6a83
e232a107\\setup.py'"'"'; __file__='"'"'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-0suiyo62\\beautifulsoup_c20dc2acaa064097abdc6a83e232a107\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.pa
th.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:\Users\Admini
strator\AppData\Local\Temp\pip-pip-egg-info-6twcllq3'
cwd: C:\Users\Administrator\AppData\Local\Temp\pip-install-0suiyo62\beautifulsoup_c20dc2acaa064097abdc6a83e232a107\
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Administrator\AppData\Local\Temp\pip-install-0suiyo62\beautifulsoup_c20dc2acaa064097abdc6a83e232a107\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://pypi.tuna.tsinghua.edu.cn/packages/40/f2/6c9f2f3e696ee6a1fb0e4d7850617e224ed2b0b1e872110abffeca2a09d4/BeautifulSoup-3.2.2.tar.gz#sha256=a04169602bff6e3138b1259dbbf491f5a27f9499dea9a8fbafd48843f9d89970 (fro
m https://pypi.tuna.tsinghua.edu.cn/simple/beautifulsoup/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/1e/ee/295988deca1a5a7accd783d0dfe14524867e31abb05b6c0eeceee49c759d/BeautifulSoup-3.2.1.tar.gz (31 kB)
ERROR: Command errored out with exit status 1:
command: 'E:\integration_test\venv\Scripts\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-0suiyo62\\beautifulsoup_23f49dc6e4244d11a291cc24
f93e841d\\setup.py'"'"'; __file__='"'"'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-0suiyo62\\beautifulsoup_23f49dc6e4244d11a291cc24f93e841d\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.pa
th.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:\Users\Admini
strator\AppData\Local\Temp\pip-pip-egg-info-9fpwb1xo'
cwd: C:\Users\Administrator\AppData\Local\Temp\pip-install-0suiyo62\beautifulsoup_23f49dc6e4244d11a291cc24f93e841d\
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Administrator\AppData\Local\Temp\pip-install-0suiyo62\beautifulsoup_23f49dc6e4244d11a291cc24f93e841d\setup.py", line 22
print "Unit tests have failed!"
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Unit tests have failed!")?
----------------------------------------
WARNING: Discarding https://pypi.tuna.tsinghua.edu.cn/packages/1e/ee/295988deca1a5a7accd783d0dfe14524867e31abb05b6c0eeceee49c759d/BeautifulSoup-3.2.1.tar.gz#sha256=6a8cb4401111e011b579c8c52a51cdab970041cc543814bbd9577a4529fe1cdb (fro
m https://pypi.tuna.tsinghua.edu.cn/simple/beautifulsoup/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Using cached https://pypi.tuna.tsinghua.edu.cn/packages/33/fe/15326560884f20d792d3ffc7fe8f639aab88647c9d46509a240d9bfbb6b1/BeautifulSoup-3.2.0.tar.gz (31 kB)
ERROR: Command errored out with exit status 1:
command: 'E:\integration_test\venv\Scripts\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-0suiyo62\\beautifulsoup_047f989148c54b1d8c4001da
6c9149b5\\setup.py'"'"'; __file__='"'"'C:\\Users\\Administrator\\AppData\\Local\\Temp\\pip-install-0suiyo62\\beautifulsoup_047f989148c54b1d8c4001da6c9149b5\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.pa
th.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:\Users\Admini
strator\AppData\Local\Temp\pip-pip-egg-info-f9_8qp1p'
cwd: C:\Users\Administrator\AppData\Local\Temp\pip-install-0suiyo62\beautifulsoup_047f989148c54b1d8c4001da6c9149b5\
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Administrator\AppData\Local\Temp\pip-install-0suiyo62\beautifulsoup_047f989148c54b1d8c4001da6c9149b5\setup.py", line 22
print "Unit tests have failed!"
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Unit tests have failed!")?
----------------------------------------
WARNING: Discarding https://pypi.tuna.tsinghua.edu.cn/packages/33/fe/15326560884f20d792d3ffc7fe8f639aab88647c9d46509a240d9bfbb6b1/BeautifulSoup-3.2.0.tar.gz#sha256=0dc52d07516c1665c9dd9f0a390a7a054bfb7b147a50b2866fb116b8909dfd37 (fro
m https://pypi.tuna.tsinghua.edu.cn/simple/beautifulsoup/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement BeautifulSoup (from versions: 3.2.0, 3.2.1, 3.2.2)
ERROR: No matching distribution found for BeautifulSoup
WARNING: You are using pip version 21.1.2; however, version 22.2.2 is available.
You should consider upgrading via the 'E:\integration_test\venv\Scripts\python.exe -m pip install --upgrade pip' command.

 

2、处理方法 pip install BeautifulSoup4

Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: BeautifulSoup4 in e:\integration_test\venv\lib\site-packages (4.11.1)
Requirement already satisfied: soupsieve>1.2 in e:\integration_test\venv\lib\site-packages (from BeautifulSoup4) (2.3.2.post1)
WARNING: You are using pip version 21.1.2; however, version 22.2.2 is available.
You should consider upgrading via the 'E:\integration_test\venv\Scripts\python.exe -m pip install --upgrade pip' command.

 

posted @ 2022-08-18 11:58  代码诠释的世界  阅读(738)  评论(0编辑  收藏  举报