Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 找不到模块组_Python - Fatal编程技术网

Python 找不到模块组

Python 找不到模块组,python,Python,我是python初学者,有一个项目需要BeautifulSoup。 在代码中,其引用方式如下: from bs4 import BeautifulSoup 虽然我使用PyCharm安装了BeeatifulSoup,但我遇到了以下错误: soup = BeautifulSoup(param) TypeError: 'module' object is not callable 当我将其更改为: from BeautifulSoup import BeautifulSoup 我得到了这个错误

我是python初学者,有一个项目需要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
进行安装。