简体   繁体   English

ValueError: source code string cannot contain null bytes while importing flask_wtf

[英]ValueError: source code string cannot contain null bytes while importing flask_wtf

I am trying to create forms for 'user registration' on a website.我正在尝试为网站上的“用户注册”创建 forms。 While trying to import flask_wtf module in Sublime Text 3 using the following input:在尝试使用以下输入在 Sublime Text 3 中导入 flask_wtf 模块时:

import flask_wtf

I am getting the following error:我收到以下错误:

    Traceback (most recent call last):
  File "C:\Users\Aadish\Desktop\Python Course Udemy\practice\Flask_blog\forms.py", line 1, in <module>
    import flask_wtf
  File "C:\Users\Aadish\AppData\Local\Programs\Python\Python39\lib\site-packages\flask_wtf\__init__.py", line 3, in <module>
    from .csrf import CSRFProtect, CsrfProtect
  File "C:\Users\Aadish\AppData\Local\Programs\Python\Python39\lib\site-packages\flask_wtf\csrf.py", line 11, in <module>
    from wtforms import ValidationError
  File "C:\Users\Aadish\AppData\Local\Programs\Python\Python39\lib\site-packages\wtforms\__init__.py", line 11, in <module>
    from wtforms import validators, widgets
  File "C:\Users\Aadish\AppData\Local\Programs\Python\Python39\lib\site-packages\wtforms\validators.py", line 9, in <module>
    import email_validator
  File "C:\Users\Aadish\AppData\Local\Programs\Python\Python39\lib\site-packages\email_validator\__init__.py", line 6, in <module>
    import dns.resolver
  File "C:\Users\Aadish\AppData\Local\Programs\Python\Python39\lib\site-packages\dns\resolver.py", line 36, in <module>
    import dns.message
  File "C:\Users\Aadish\AppData\Local\Programs\Python\Python39\lib\site-packages\dns\message.py", line 24, in <module>
    import dns.wire
  File "C:\Users\Aadish\AppData\Local\Programs\Python\Python39\lib\site-packages\dns\wire.py", line 7, in <module>
    import dns.name
  File "C:\Users\Aadish\AppData\Local\Programs\Python\Python39\lib\site-packages\dns\name.py", line 26, in <module>
    import idna          # type: ignore
ValueError: source code string cannot contain null bytes

It looks like your source files are messed up.看起来你的源文件搞砸了。 Try to reinstall the dns library.尝试重新安装dns库。 If it does not help, manually edit the file C:\Users\Aadish\AppData\Local\Programs\Python\Python39\lib\site-packages\dns\name.py to fix the problem.如果没有帮助,请手动编辑文件C:\Users\Aadish\AppData\Local\Programs\Python\Python39\lib\site-packages\dns\name.py以解决问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 导入没有空字节的模块时,出现 ValueError: source code string cannot contain null bytes - When importing a module without null bytes I get ValueError: source code string cannot contain null bytes ValueError: source code string cannot contain null bytes with django - ValueError: source code string cannot contain null bytes with django ValueError:源代码字符串不能包含空字节 - ValueError: source code string cannot contain null bytes PyInstaller “ValueError:源代码字符串不能包含 null 字节” - PyInstaller “ValueError: source code string cannot contain null bytes” Python - ValueError:源代码字符串不能包含 null 字节 - Python - ValueError: source code string cannot contain null bytes ValueError:在inspectdb之后运行python manage.py migrate时,源代码字符串不能在django中包含空字节 - ValueError: source code string cannot contain null bytes in django while running python manage.py migrate after inspectdb ValueError: 源代码字符串不能包含空字节 mysql.connector - ValueError: source code string cannot contain null bytes mysql.connector 如何修复“ValueError:源代码字符串不能包含 null 字节” - How do I fix “ValueError: source code string cannot contain null bytes” ValueError: source code string cannot contain null bytes in django 只要我运行 mange.py - ValueError: source code string cannot contain null bytes in django anytime i run mange.py Python 导入失败并显示消息:ValueError:源代码字符串不能包含空字节 - Python import fails with message: ValueError: source code string cannot contain null bytes
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM