0

Ipython Version used: 2.3.1

Auto-reload extension of ipython isn't working for me. I have already seen this question and tried various combinations of it in my ipython_config.py including:

c.InteractiveShellApp.extensions = ['autoreload']
c.InteractiveShellApp.exec_lines = ['%autoreload 2']

Also tried a new option:

c.TerminalInteractiveShell.deep_reload = True

But none seem to be working. I also tried loading the extension at the ipython shell:

In [7]: %load_ext autoreload
The autoreload extension is already loaded. To reload it, use:
  %reload_ext autoreload

In [8]: %autoreload 2

So, it seems the extension have already loaded. But when I edit and save my file, it's not getting reloaded (Returning the same old value of my test function). Any ideas on what may be wrong ?

Community
  • 1
  • 1
Sibi
  • 47,472
  • 16
  • 95
  • 163
  • I'm using ipython 2.3.0 and that works for me, so I'm not sure that it's a config file issue. Will post what I have below so you can double check. Maybe post the test py you're using? – Aidan Kane Dec 15 '14 at 12:14
  • @AidanKane This is the [ipython configuration](https://gist.github.com/psibi/ecd8ef354b393ced87cf) file. and this is the [test script](https://gist.github.com/psibi/6a82d667695419091766) – Sibi Dec 15 '14 at 12:18
  • Definitely looks ok. I'd double check by stripping everything out and just leaving the lines you need, but really, it looks fine. Try running the very simple test I posted below. – Aidan Kane Dec 15 '14 at 12:20

1 Answers1

1

Config that's working perfectly for me in ipython 2.3.0

c = get_config()
c.InteractiveShellApp.exec_lines = ['%autoreload 2']
c.InteractiveShellApp.extensions = ['autoreload']
c.TerminalInteractiveShell.autoindent = False

Try testing with something very simple:

test.py

def print_something():
    print('thing')

ipython

>>> import test
>>> test.print_something()
thing
>>> # change 'thing' -> 'other'
>>> test.print_something()
other
Aidan Kane
  • 3,856
  • 2
  • 25
  • 28