简体   繁体   English

SQL iPython Magic 扩展不会加载

[英]SQL iPython Magic Extension won't load

Just installed the iPython-SQL extenson, but when I run刚刚安装了 iPython-SQL extenson,但是当我运行时

%load_ext sql

I get an error "The sql module is not an IPython extension."我收到错误消息“sql 模块不是 IPython 扩展”。 I installed it via pip by我通过 pip 安装了它

pip install ipython-sql

and when that didn't seem to work, even by downloading the file from Github and executing the code.当这似乎不起作用时,即使从 Github 下载文件并执行代码也是如此。 Searching "The sql module is not an IPython extension."搜索“sql 模块不是 IPython 扩展”。 itself yielded 0 results in Google, so I am a little lost on what I might be doing wrong.本身在谷歌中产生了 0 个结果,所以我对我可能做错的事情有点迷茫。

I am running OSX El Capitan (with SIS disabled), and my Python/iPython version is as below:我正在运行 OSX El Capitan(禁用 SIS),我的 Python/iPython 版本如下:

Python 2.7.10 |Anaconda 2.4.0 (x86_64)| (default, Oct 19 2015, 18:31:17) 
[GCC 4.2.1 (Apple Inc. build 5577)]

Since you're using Anaconda's Python, make sure you install with the associated package manager conda:由于您使用的是 Anaconda 的 Python,请确保使用相关的包管理器 conda 安装:

conda install -c conda-forge ipython-sql=0.3.6

Source: https://anaconda.org/conda-forge/ipython-sql来源: https ://anaconda.org/conda-forge/ipython-sql

I was getting the error on a notebook that no module named no module named sql .我在笔记本上收到错误,没有名为no module named sql的模块。 I did pip install python-sql and it then it gave the same error you had.我做了pip install python-sql然后它给出了与您相同的错误。 I used %reload_ext sql instead of %load_ext sql and it seems to be working.我使用%reload_ext sql而不是%load_ext sql ,它似乎可以正常工作。 Maybe it will work for you.也许它会为你工作。

In my case the problem was that I had a file called sql.py in my working folder...在我的例子中,问题是我的工作文件夹中有一个名为sql.py的文件......

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM