views:

85

answers:

1

I am on MacOSX Snow Leopard and I'm using python 2.6.5 installed with macports. I'm inside a virtualenv. I can't run python manage.py shell after installing IPython but I can run IPython standalone.

I figured out that the following line is what causes the issue:

(status, result) = commands.getstatusoutput("otool -L %s | grep libedit" % _rl.__file__ )

This happens because for a strange reason, the method getstatusoutput is not available when i launch python manage.py shell but it's available when I launch ipython. I can import the commands module in both cases. I tried looking at the sys.path during the execution of both, but there are no differences.

A: 

Are they the same commands? Try print commands.__file__ in each. You may find that your project has a module called "commands" which shadows the stdlib module.

Ignacio Vazquez-Abrams
No, one (working) is inside the macports installation /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/commands.pyc, the other one (not working) is inside the virtualenv /Users/ingo/Documents/django_projects/project/project/commands/__init__.pyc. In the meanwhile I found a bug report on the ipython tracker https://bugs.launchpad.net/ipython/+bug/416162
Ingo86
Well there you go. They're completely different. This is neither a IPython bug or a Django bug, this is just how Python works. Rename the app.
Ignacio Vazquez-Abrams
Oh god! Thank you!
Ingo86