Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

IPython 5.1.0 not working with Flask-Script 2.0.5 #171

Open
SlangingCode opened this issue Dec 13, 2016 · 1 comment
Open

IPython 5.1.0 not working with Flask-Script 2.0.5 #171

SlangingCode opened this issue Dec 13, 2016 · 1 comment

Comments

@SlangingCode
Copy link

Hello,

I get the following error when trying to use IPython 5.1.0 with Flask-Script 2.0.5:

ImportError                               Traceback (most recent call last)
...\AppData\Local\Programs\Python\Python35\lib\site-packages\flask_script\commands.py in run(self, no_ipython, no_bpython)
    299                     # 0.10.x
--> 300                     from IPython.Shell import IPShellEmbed
    301                     ipshell = IPShellEmbed(banner=self.banner)

ImportError: No module named 'IPython.Shell'

Any chance someone can give me some guidance on fixing this? (And no, using IPython.embed() does not fix it.)

If I can get a little guidance, I would be willing to fix for the current version of Flask 0.11.1 and the upcoming 1.x version.

@SlangingCode
Copy link
Author

Here's the manage.py file that I created:

#!/usr/bin/env python

from flask_script import Manager
from app import app

manager = Manager(app)


@manager.shell
def make_shell_context():
    """ Creates a python REPL with several default imports
        in the context of the app
    """

    return dict(app=app)

if __name__ == "__main__":
    manager.run()

I am running the following command:

python manage.py shell

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant