0

I'm using InteractiveShellEmbed from IPython.terminal.embed to embed IPython in my app. All works rigth, but autocomplete not works with modules. For example: import rand[TAB] doesn't completes to import random. What can I do to fix this?

My code:

# -*- coding: utf-8 -*-
#!/usr/bin/env python

def main():

    from IPython.terminal.embed import InteractiveShellEmbed

    ipshell = InteractiveShellEmbed(banner1 = 'Loading\n',
                                    exit_msg = 'Leaving')


    ipshell('Hit Ctrl-D to exit interpreter.\n')

if __name__ == "__main__":
    main()
Pablo
  • 121
  • 4

1 Answers1

0

The autocomplete functionality seems to be working for me for iPython 5.1.0 with python 2.7.6. What version of iPython are you using? Do you have the same issue if you just use 'from IPython import embed' and then call 'embed()' in your app where you want?

---Update:

Try making an explicit instance:

ipshell = InteractiveShellEmbed.instance()

Dustin Gault
  • 157
  • 1
  • 5
  • Thanks for your reply! I'm using IPython 4.2.0 with Python 3.4.2. Using from IPython import embed; embed() autocomplete works right. The issue is using InteractiveShellEmbed. – Pablo Dec 12 '16 at 21:35
  • Try this: ipshell = InteractiveShellEmbed.instance() – Dustin Gault Dec 12 '16 at 22:36