"SQLAlchemy"的实例没有“列"成员(无成员) [英] Instance of 'SQLAlchemy' has no 'Column' member (no-member)

查看:133
本文介绍了"SQLAlchemy"的实例没有“列"成员(无成员)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试实施Steam登录网站.但是我无法在代码中传递此错误.我已经创建了数据库对象,但是它一直显示我前面提到的错误.我不确定SQLAlchemy是否已更改或自使用以来发生了什么.

I'm currently trying to implement steam login into website. But I'm unable to get pass this error within the code. I've created the database object but it keeps showing the error I mentioned earlier. I'm not sure whether SQLAlchemy has changed or what since I used it.

from flask import Flask
from flask_sqlalchemy import SQLAlchemy

app = Flask(__name__)
db = SQLAlchemy(app)

class User(db.Model):
    id = db.Column(db.Integer, primary_key=True)

pylint给出的错误是

E1101: Instance of 'SQLAlchemy' has no 'Column' member (no-member)

在项目目录中的

推荐答案

找到文件夹.vscode(如果没有,只需创建它),然后创建文件settings.json并添加此行

on your project directory find folder .vscode (if you dont have it, just create it) then create file settings.json and add this line

{
    "python.linting.pylintArgs": [
        "--load-plugins",
        "pylint-flask"
    ]
}

您还需要在当前的python环境中安装 pylint-flask :

You also need to have pylint-flask installed in your current python environment:

pip install pylint-flask

这篇关于"SQLAlchemy"的实例没有“列"成员(无成员)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆