Traceback (most recent call last):
File "C:\Users\emwod\AppData\Local\Programs\Python\Python310\lib\site-packages\bs4\dammit.py", line 28, in <module>
import cchardet as chardet_module
ModuleNotFoundError: No module named 'cchardet'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\emwod\AppData\Local\Programs\Python\Python310\lib\site-packages\bs4\dammit.py", line 33, in <module>
import chardet as chardet_module
ModuleNotFoundError: No module named 'chardet'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/emwod/AppData/Local/Programs/Python/Python310/scrape.py", line 1, in <module>
import bs4 as bs
File "C:\Users\emwod\AppData\Local\Programs\Python\Python310\lib\site-packages\bs4\__init__.py", line 37, in <module>
from .builder import (
File "C:\Users\emwod\AppData\Local\Programs\Python\Python310\lib\site-packages\bs4\builder\__init__.py", line 9, in <module>
from bs4.element import (
File "C:\Users\emwod\AppData\Local\Programs\Python\Python310\lib\site-packages\bs4\element.py", line 19, in <module>
from bs4.formatter import (
File "C:\Users\emwod\AppData\Local\Programs\Python\Python310\lib\site-packages\bs4\formatter.py", line 1, in <module>
from bs4.dammit import EntitySubstitution
File "C:\Users\emwod\AppData\Local\Programs\Python\Python310\lib\site-packages\bs4\dammit.py", line 37, in <module>
import charset_normalizer as chardet_module
ValueError: source code string cannot contain null bytes
=== RESTART: C:/Users/emwod/AppData/Local/Programs/Python/Python310/scrape.py ==
Traceback (most recent call last):
File "C:\Users\emwod\AppData\Local\Programs\Python\Python310\lib\site-packages\bs4\dammit.py", line 28, in <module>
import cchardet as chardet_module
ModuleNotFoundError: No module named 'cchardet'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\emwod\AppData\Local\Programs\Python\Python310\lib\site-packages\bs4\dammit.py", line 33, in <module>
import chardet as chardet_module
ModuleNotFoundError: No module named 'chardet'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/emwod/AppData/Local/Programs/Python/Python310/scrape.py", line 1, in <module>
from bs4 import BeautifulSoup as bs
File "C:\Users\emwod\AppData\Local\Programs\Python\Python310\lib\site-packages\bs4\__init__.py", line 37, in <module>
from .builder import (
File "C:\Users\emwod\AppData\Local\Programs\Python\Python310\lib\site-packages\bs4\builder\__init__.py", line 9, in <module>
from bs4.element import (
File "C:\Users\emwod\AppData\Local\Programs\Python\Python310\lib\site-packages\bs4\element.py", line 19, in <module>
from bs4.formatter import (
File "C:\Users\emwod\AppData\Local\Programs\Python\Python310\lib\site-packages\bs4\formatter.py", line 1, in <module>
from bs4.dammit import EntitySubstitution
File "C:\Users\emwod\AppData\Local\Programs\Python\Python310\lib\site-packages\bs4\dammit.py", line 37, in <module>
import charset_normalizer as chardet_module
ValueError: source code string cannot contain null bytes
我试图启动bs4
,但发生了这种情况
1条答案
按热度按时间rjjhvcjd1#
模块未找到错误:没有名为"cchardet"的模块
似乎不是一个严格的
BeautifulSoup
主题-缺少一个模块,所以如果您喜欢使用它,您应该安装它或将其放在路径中:cchardet
,因此问题的一些改进将是很好的。如何创建mcve。