【问题标题】:IPython doesn't work in Django shellIPython 在 Django shell 中不起作用
【发布时间】:2011-01-07 17:18:10
【问题描述】:

我最近刚刚切换到在 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 选项,但这并不是真正的解决方案。非常感谢您的任何帮助!

【问题讨论】:

标签: python django osx-snow-leopard


【解决方案1】:

IPython 0.11 有一个不同的 API,在最新的 Django 版本中已对此进行了修复。

对于较旧的 Django 版本,您可以使用 IPython 0.10,它确实有效:

pip install ipython==0.10

【讨论】:

    【解决方案2】:

    当您从 Python 交互式控制台运行它时,这是否有效?

    import IPython; IPython.Shell
    

    【讨论】:

    • 我得到的答案与尝试在没有 --plain 标志的情况下运行服务器时相同。 AttributeError:“模块”对象没有属性“外壳”
    【解决方案3】:

    我遇到了同样的问题,并通过应用 Django 错误的补丁解决了这个问题。 - IPython doesn't find the Shell.IPShell class

    【讨论】:

      猜你喜欢
      • 2018-06-02
      • 2014-11-29
      • 2017-08-23
      • 2018-04-20
      • 2013-05-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-21
      相关资源
      最近更新 更多