Django manage.py与IPython不兼容
我在使用MacOSX Snow Leopard系统,安装了macports的python 2.6.5。我现在在一个虚拟环境里。安装了IPython后,我无法运行 python manage.py shell
,但可以单独运行IPython。
我发现导致这个问题的原因是以下这一行:
(status, result) = commands.getstatusoutput("otool -L %s | grep libedit" % _rl.__file__ )
这个问题的出现是因为一个奇怪的原因,当我运行 python manage.py shell
时,getstatusoutput
这个方法不可用,但在我运行 ipython
时却可以使用。我在这两种情况下都能导入commands模块。我尝试查看在执行这两者时的sys.path,但没有发现有什么不同。
1 个回答
0
它们是一样的commands
吗?你可以在每个地方试试print commands.__file__
。你可能会发现你的项目里有一个叫“commands”的模块,它覆盖了标准库里的那个模块。