Python 找不到模块组
我是python初学者,有一个项目需要BeautifulSoup。 在代码中,其引用方式如下:Python 找不到模块组,python,Python,我是python初学者,有一个项目需要BeautifulSoup。 在代码中,其引用方式如下: from bs4 import BeautifulSoup 虽然我使用PyCharm安装了BeeatifulSoup,但我遇到了以下错误: soup = BeautifulSoup(param) TypeError: 'module' object is not callable 当我将其更改为: from BeautifulSoup import BeautifulSoup 我得到了这个错误
from bs4 import BeautifulSoup
虽然我使用PyCharm安装了BeeatifulSoup,但我遇到了以下错误:
soup = BeautifulSoup(param)
TypeError: 'module' object is not callable
当我将其更改为:
from BeautifulSoup import BeautifulSoup
我得到了这个错误,其中使用了BeautifulSoup对象:
links = soupObject.find_all("a")
TypeError: 'NoneType' object is not callable
当我换成:
import BeautifulSoup
我收到这个错误:
soup = BeautifulSoup(param)
TypeError: 'module' object is not callable
我真的不知道为什么这个代码在我的机器上不起作用?
我怎样才能修好它?感谢您在PyCharm中搜索可用软件包以安装到您的环境中,如果您需要使用v4+,请查找
beautifulsoup
确保安装beautifulsoup4
,而不是beautifulsoup4
。您使用的是beautifulsoup4还是BeautifulSoup3?当您在PyCharm中搜索可用的软件包以安装到您的环境中时,如果您需要使用v4+,请查找beautifulsoup
确保安装beautifulsoup4
而不是beautifulsoup
。我在PyCharm中只找到了3个,这会是问题吗?谢谢你的帮助@KevinGuan@JohnSmith是的,这就是问题所在<代码>从bs4导入美化组表示从美化组4…
。但是,使用Beautifulsoup4是一个好主意。从下载Beautifulsoup4-4.4.1.tar.gz
文件,然后使用python setup.py install
进行安装。