1. Dan Jacob
  2. Flask-Script
  3. Issues
Issue #23 new

Shell command fails when IPython>=0.11 is installed

Anonymous created an issue

Stacktrace:

{{{ sef$ python manage.py shell Traceback (most recent call last): File "manage.py", line 11, in <module> manager.run() File "/Users/sef/.virtualenvs/v1/lib/python2.7/site-packages/flaskext/script.py", line 684, in run sys.argv[2:]) File "/Users/sef/.virtualenvs/v1/lib/python2.7/site-packages/flaskext/script.py", line 655, in handle command.handle(app, *positional_args, command_namespace.__dict__) File "/Users/sef/.virtualenvs/v1/lib/python2.7/site-packages/flaskext/script.py", line 192, in handle self.run(*args, kwargs) File "/Users/sef/.virtualenvs/v1/lib/python2.7/site-packages/flaskext/script.py", line 283, in run sh = IPython.Shell.IPShellEmbed(banner=self.banner) AttributeError: 'module' object has no attribute 'Shell' }}}

Comments (3)

  1. Mikhail Lukyanchenko

    This one works for me:

    --- a/flaskext/script.py
    +++ b/flaskext/script.py
    @@ -280,8 +280,8 @@
             if not no_ipython:
                 try:
                     import IPython
    -                sh = IPython.Shell.IPShellEmbed(banner=self.banner)
    -                sh(global_ns=dict(), local_ns=context)
    +                sh = IPython.embed(banner2=self.banner, user_ns=context)
    +                sh()
                     return
                 except ImportError:
                     pass
    
  2. Log in to comment