python 调试Django程序时错误 "AttributeError: 'module' object has no attribute 'Shell'"

解决Django Python运行错误:'module'无'shell'属性
在尝试使用Python管理Django项目并运行manage.py时,遇到了一个错误:AttributeError: 'module' object has no attribute 'Shell'。这通常意味着在调用Django的shell命令时出现了问题。可能的原因包括导入冲突、未正确安装Django或者manage.py文件存在错误。解决此问题的方法包括检查Python路径、确保Django已正确安装以及验证manage.py文件的内容是否正确。

运行django manage.py时出现如下错误:

[root@va3 hello]# python manage.py shell                               
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_manager(settings)
  File "/usr b/python2.6/site-packages/django/core/management/__init__.py", line 362, in execute_manager
    utility.execute()
  File "/usr b/python2.6/site-packages/django/core/management/__init__.py", line 303, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr b/python2.6/site-packages/django/core/management/base.py", line 195, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr b/python2.6/site-packages/django/core/management/base.py", line 222, in execute
    output = self.handle(*args, **options)
  File "/usr b/python2.6/site-packages/django/core/management/base.py", line 351, in handle
    return self.handle_noargs(**options)
  File "/usr b/python2.6/site-packages/django/core/management/commands/shell.py", line 29, in handle_noargs
    shell = IPython.Shell.IPShell(argv=[])
AttributeError: 'module' object has no attribute 'Shell'
[root@va3 hello]# 

解决方法很简单:

sudo pip uninstall ipython
sudo pip install ipython==0.10


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值