我可以导入请求库
我无法导入请求库并获得此错误:
import requests
File "C:\Users\Tochka2061\AppData\Roaming\Python\Python310\site-packages\requests\__init__.py", line 45, in <module>
from .exceptions import RequestsDependencyWarning
File "C:\Users\Tochka2061\AppData\Roaming\Python\Python310\site-packages\requests\exceptions.py", line 11, in <module>
from .compat import JSONDecodeError as CompatJSONDecodeError
File "C:\Users\Tochka2061\AppData\Roaming\Python\Python310\site-packages\requests\compat.py", line 33, in <module>
import simplejson as json
ValueError: source code string cannot contain null bytes
如何解决?我已经尝试删除Python并再次安装,它没有帮助。
i cant import requests library and get this error:
import requests
File "C:\Users\Tochka2061\AppData\Roaming\Python\Python310\site-packages\requests\__init__.py", line 45, in <module>
from .exceptions import RequestsDependencyWarning
File "C:\Users\Tochka2061\AppData\Roaming\Python\Python310\site-packages\requests\exceptions.py", line 11, in <module>
from .compat import JSONDecodeError as CompatJSONDecodeError
File "C:\Users\Tochka2061\AppData\Roaming\Python\Python310\site-packages\requests\compat.py", line 33, in <module>
import simplejson as json
ValueError: source code string cannot contain null bytes
How i can solve it? Ive already tried to delete python and install it again, it didnt help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
@trepetaky我能够通过使用
pip install Chardet
安装缺失的模块片来解决此问题@Trepetaky I was able to resolve this issue by installing the missing module chardet with
pip install chardet