相关疑难解决方法(0)

BeautifulSoup4 无法在 Windows7 上的 python3.5 中安装

我已经从https://www.crummy.com/software/BeautifulSoup/bs4/download/4.5/下载了 beautifulsoup4-4.5.3.tar.gz并将其解压缩到我的 python 工作目录(这不是我的 python 安装目录) .

然而,当我跑

from bs4 import BeautifulSoup
Run Code Online (Sandbox Code Playgroud)

在我的 IDLE 中,错误消息弹出:

>>> from bs4 import BeautifulSoup
Traceback (most recent call last):
File "<pyshell#6>", line 1, in <module>
from bs4 import BeautifulSoup
File "D:\python\beautifulsoup4-4.5.3\beautifulsoup4-4.5.3\bs4\__init__.py", 
line 53
'You are trying to run the Python 2 version of Beautiful Soup under Python 
3. This will not work.'<>'You need to convert the code, either by installing 
it (`python setup.py install`) or by running 2to3 (`2to3 -w …
Run Code Online (Sandbox Code Playgroud)

windows installation beautifulsoup python-2to3 python-3.x

5
推荐指数
1
解决办法
1万
查看次数