vscode中错误信息:Instance of 'Session' has no 'add' member处理方式


问题:

在使用MySQL ORM框架 sqlalchemy包时,我在创建sessionmaker实例Session后将创建的数据对象添加进去发现报错:Instance of 'Session' has no 'add' member pylint(no-member)[31,1],在网上查询后得知解决方案:

点击设置→右上角点击打开设置(json)→在大括号中已有代码下添加代码:

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

保存后就没有报错了。

参考博客:https://blog.csdn.net/weixin_42236031/article/details/106960189


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM