Tony McDonald
Tony McDonald

Reputation: 23

IPython magic extension not found

I want to look at a database schema using %load_ext schemadisplay_magic then %schema but schemadisplay_magic will load. I get an error message saying:

No module named 'schemadisplay_magic'

IPython version 5.8.0

I have tried looking it up, but can't find anything about it anywhere.

%load_ext sql
%load_ext schemadisplay_magic

I expected to be able to load %schema, but i just get an error message.

ModuleNotFoundError: No module named 'schemadisplay_magic'

Upvotes: 2

Views: 737

Answers (1)

Joe Germuska
Joe Germuska

Reputation: 1698

It seems as though this magic is the creation of innovationOUtside and hasn't been published on PyPi -- here's the git repository

you can install it using

pip install git+https://github.com/innovationOUtside/ipython_magic_sqlalchemy_schemadisplay.git#egg=ipython_magic_sqlalchemy_schemadisplay

I was testing it in a virtualenv with a bunch of stuff already installed, so this may not be an issue in a clean environment, but I found that I also needed to upgrade sqlalchemy-schemadisplay beyond the 1.3 that's on PyPi. I used this command:

pip install -U git+https://github.com/fschulze/sqlalchemy_schemadisplay.git#egg=sqlalchemy-schemadisplay

Trying to use the ipython magic with sqlalchemy-schemadisplay 1.3 results in this error:

TypeError: create_schema_graph() got an unexpected keyword argument 'restrict_tables'

Upvotes: 2

Related Questions