diff --git a/scrapy/utils/console.py b/scrapy/utils/console.py index 9edf36e39..c376ed059 100644 --- a/scrapy/utils/console.py +++ b/scrapy/utils/console.py @@ -11,7 +11,10 @@ def start_python_console(namespace=None, noipython=False): if noipython: raise ImportError import IPython - shell = IPython.Shell.IPShellEmbed(argv=[], user_ns=namespace) + try: + shell = IPython.embed(user_ns=namespace) + except AttributeError: + shell = IPython.Shell.IPShellEmbed(argv=[], user_ns=namespace) shell() except ImportError: import code