Visual Studio代码[pylint]E0001:语法无效

2024-04-24 13:48:13 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用的是带有ms-python.python扩展名的visualstudio代码,当我使用from xxxx import xxxx导入函数或类时,在许多不同的文件中都会出现此错误。在

即使我只有两三行代码,我也会得到这个错误。在

from django import forms
from django.core import validate # <-- error on this line.
from app_two.models import users

Tags: 文件django函数代码fromcoreimporton
1条回答
网友
1楼 · 发布于 2024-04-24 13:48:13

基于您链接的示例(而不是您的编辑);您没有使用from xxxx import xxxx。正如您的错误所示,您正在使用无效语法,方法是执行from xxxx import,这是无效的。在

而不是

from django.core import

你应该试试:

^{pr2}$

相关问题 更多 >