Issue
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 ?
Solution
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
Answered By - Aidan Kane
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.