IPython 无法在 Django shell 中工作
我最近刚刚在 Mac OS X 10.6 (Snow Leopard) 上改用 64 位 Python 2.6.1。 IPython 不再与 Django 一起使用,但 IPython 可在命令行中工作。
错误说:
shell = IPython.Shell.IPShell(argv=[])
AttributeError: 'module' object has no attribute 'Shell'
我可以使用 ./manage.py --plain
选项,但这并不是真正的修复。非常感谢您的帮助!
I've just recently switched over to using 64-bit Python 2.6.1 on Mac OS X 10.6 (Snow Leopard). IPython won't work with Django anymore, but IPython works from the command-line.
The error says:
shell = IPython.Shell.IPShell(argv=[])
AttributeError: 'module' object has no attribute 'Shell'
I could use the ./manage.py --plain
option, but it's not really a fix. Any help very gratefully received!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
IPython 0.11 有一个不同的 API,最新的 Django 版本中对此进行了修复。
对于较旧的 Django 版本,您可以使用 IPython 0.10,它确实有效:
IPython 0.11 has a different API, for which a fix exists in the last Django versions.
For older Django versions, you can use IPython 0.10, which does work:
当您从 Python 交互式控制台运行它时,这是否有效?
Does this work when you run it from Python interactive console?
我遇到了同样的问题,并通过应用 Django bug 的补丁解决了这个问题。 - IPython 找不到 Shell.IPShell 类
I got the same problem, and solved this issue by applying the patches for the Django bug. - IPython doesn't find the Shell.IPShell class