3

I'm working on the project1 from cs50web course.

Getting the following problem using flask and SQLAlchemy: "Instance of 'scoped_session' has no 'execute' memberpylint(no-member)".

I use Ubuntu 18.04, Flask. I suppose that the problem is somehow related to SQLAlchemy libarary or some adjustments should be done to the confiquration files.

How can I fix this problem?

enter image description here

3 Answers 3

7

They are warnings from pylint. You can tell pylint to ignore that error by create file .pylintrc in your folder with contains:

ignored-classes=SQLObject,Registrant,scoped_session

reference link: https://stackoverflow.com/questions/42789666/pylint-error-message-on-cloud-9-cs50

0

this helped me Instance of 'scoped_session' has no 'commit' member

enter image description here

-1

You need to import from flask_sqlalchemy import SQLAlchemy

and then create a instance of it by writing db = sqlalchemy(app)

This way

enter image description here

1
  • Not everyone is running a Flask app. This is not about Flask packages, but about SQLAlchemy and Pylint errors. Commented Nov 12, 2021 at 16:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .