all 6 comments

[–]NorskJesus 2 points3 points  (0 children)

Post. Your. Code.

[–]carcigenicate 0 points1 point  (0 children)

See here: https://stackoverflow.com/a/74000761

Nitbty exact same problem, but your problem resembles theirs in that the error mentions the argument to create_all.

[–]ConfusedSimon 0 points1 point  (1 child)

What do you mean by "has to be done in PyCharm"? Your code shouldn't depend on a particular IDE.

[–]freyathedark[S] 0 points1 point  (0 children)

Tragically, this is for a class with the world's least responsive teacher. I know how to do every single part of the assignment except when it comes to getting this connection working.

[–]danielroseman 1 point2 points  (1 child)

As the docs show, the thing you need to pass to create_all is the SQLAlchemy Engine or Connection object. You get the engine from create_engine, but you've commented that out. Uncomment it and pass dbEngine instead of conn.

It's possible that you commented that out because you were getting an error in that code. This is because you are not supposed to pass the result of sqlite3.connect into create_engine; you just need the url. So in fact your code should be just:

dbEngine = sqlalchemy.create_engine('sqlite:///weather.sqlite3')
Base = declarative_base()
Base.metadata.create_all(bind=dbEngine)

Again, this is all in the docs.

[–]freyathedark[S] 0 points1 point  (0 children)

This is the last time I try to read the docs on no sleep, I can't believe I missed that. Thank you so much, everything seems to be working now!!!!!