DEV Community

Kennedy Chege
Kennedy Chege

Posted on

How to Fix SQL Magic Errors in Jupyter Notebook After SQLAlchemy Update

Just recently, SQLAlchemy just released the 2.0.12 version. While this is some great news, it has brought along some code breaks when trying to load up the SQL_Magic dependencies on Jupyter Notebook.

This is what you might be seeing:

Example %%read_sql error from SQLAlchemy update

Without the SQL_magic dependency on Jupyter Notebook, an array of problems will crop from not being able to manipulate the data in tables and the database you are working on.

Solution to this!

Only the version 1.4.47 of the SQLAlchemy is running properly without the code breaking.
Just open up your Command Prompt and first uninstall the current SQLAlchemy version using:

pip unistall Sqlalchemy

Then reinstall the SQLAlchemy version 1.4.47 using the following:
pip install SQLAlchemy==1.4.47

After this, just close your Jupyter notebook(Anaconda) and restart it again.

TADA!
That should solve everything.

GOODLUCK!

Top comments (0)