Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ipython can't load sql

I have installed pip install ipython-sql. I am trying to run

%load_ext sql

but it returns

The sql module is not an IPython extension.

How can I get sql running in ipython?

like image 718
Echo Avatar asked Oct 18 '22 13:10

Echo


1 Answers

Is it possible that you are running a different version of python than you've installed the extension for? After you execute the ipython command, if the first line of output is something like:

Python 3.5.0 (default, Sep 14 2015, 02:37:27)

which indicates Python 3, rather than something like:

Python 2.7.11 (default, Feb 23 2016, 16:17:28)

which indicates Python 2, then you should try installing the extension using pip3

pip3 install ipython-sql

in order to make it available to the version of ipython that you are running.

like image 139
Matthew Cox Avatar answered Nov 01 '22 17:11

Matthew Cox