How to automatically reload modules in IPython? -
before begin, want not programmer; geek , engineer. thus, love coding , use academically. stackoverflow taught me more 80% of know python.
my problem need manually reload modules in scripts first importing importlib terminal , using importlib.reload(*modulename*)
reload them. want ipython terminal automatically reload modules in python scripts when run them through ipython terminal. functionally provided in previous version using magic command %autoreload
, not seem work me.
i have looked @ ipython documentation (link 1), tried using %load_ext autoreload
command (link 2) , import ipy_autoreload
followed %autoreload 2
command (link 3). found more 4 other answers in stackoverflow telling me things in either link 2 or 3; didn't work me. if knows how bring autoreloading, make fingers bit happier.
link 1: https://ipython.org/ipython-doc/3/config/extensions/autoreload.html
link 2: https://stackoverflow.com/a/18216967/5762140
link 3: https://stackoverflow.com/a/4765191/5762140
i using 64 bit installation of windows 7. have ipython 4.0.1 came installation of anaconda3 (3.18.9 64bit). screenies error traceback ipython terminal when try use %load_ext autoreload
can provided on request.
all links have above use commands within ipython. should try editing config file. open terminal , complete following steps.
step 1: make sure have latest ipython version installed
$ ipython --version
step 2: find out config file is
$ ipython profile create
step 3: open config file editor based on location of config file. use atom. example:
$ atom ~/.ipython/profile_default/ipython_config.py
step 4: following lines in config file:
c.interactiveshellapp.extensions = []
change to:
c.interactiveshellapp.extensions = ['autoreload']
and uncomment line
find:
c.interactiveshellapp.exec_lines = []
change to:
c.interactiveshellapp.exec_lines = ['%load_ext autoreload', '%autoreload 2']
and uncomment line
done.
Comments
Post a Comment