Skip to content
Advertisement

function object has no attribute ‘connect’

Seems there’s a problem with my sql alchemy connection, don’t get why? it works sometimes and then doesn’t the next. Also vs code isn’t auto recommending sql alchemy methods, maybe I’ve set it up wrong?

–database.py file

JavaScript

main file

JavaScript

ERROR I GET:

JavaScript

It seems to me that the query method from sql alchemy isnt working for some reason. It doesn’t autocomplete on vs code either.I’ve tried the other variants: sql_expresson ,

Advertisement

Answer

I was looking through the SQL alchemy documentation. The engine connection url was in double-quotes there….so I changed that in my document…..it worked.

JavaScript

became

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement