在 使用自动模块加载的时候
%load_ext autoreload %autoreload 2
ERROR: Magic function `load_ext` not found.
以前都是在ubuntu的开发环境用这个,到了centos服务器端联调的时候,每次都重新搞真心很麻烦。。。。
官方说:
ipython -V: 0.10 and python -V Python 2.6.6
ipython -V: 0.10.1 and python -V Python 2.7.3
卸载pip和ipython环境
升级python到2.7
http://li.nux.ro/download/nux/dextop/el6/x86_64/python27-libs-2.7.3-6.2.el6.nux.x86_64.rpm
http://li.nux.ro/download/nux/dextop/el6/x86_64/python27-2.7.3-6.2.el6.nux.x86_64.rpm
http://li.nux.ro/download/nux/dextop/el6/x86_64/tkinter27-2.7.3-6.2.el6.nux.x86_64.rpm
http://li.nux.ro/download/nux/dextop/el6/x86_64/python27-devel-2.7.3-6.2.el6.nux.x86_64.rpm
然后重新安装pip环境
先安装setup-tools
wget https://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg --no-check-certificate chmod +x setuptools-0.6c11-py2.7.egg sh setuptools-0.6c11-py2.7.egg
安装pip
wget https://pypi.python.org/packages/source/p/pip/pip-1.3.1.tar.gz --no-check-certificate cp pip-1.3.1.tar.gz /usr/src/ tar zxvf pip-1.3.1.tar.gz cd pip-1.3.1 python setup.py install ln -s /usr/local/python2.7/bin/pip /usr/bin/pip
这个时候在安装pip install ipython
这个时候在运行自动加载就不会出问题了。。。。。
ipython在python2.6 下,不退出ipython下重载模块,貌似不好搞,最少我是没搞定过,有解决的朋友提供下解决的办法。
推荐大家bpython,一个比ipython看起来更不错的东西。
Traceback (most recent call last): File "/usr/bin/bpython", line 5, in <module> from pkg_resources import load_entry_point File "/usr/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 2603, in <module> File "/usr/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 666, in require File "/usr/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 565, in resolve pkg_resources.DistributionNotFound: bpython==0.9.7.1
但是这东西和ipython一样,挑版本。。。。