Okay quick fix: which python
gives you /usr/bin/python , right? Do which ipython
and I bet that'll be /usr/local/bin/ipython . Let's look inside: cat /usr/local/bin/ipython
#!/usr/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'ipython==0.12.1','console_scripts','ipython'
__requires__ = 'ipython==0.12.1'
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.exit(
load_entry_point('ipython==0.12.1', 'console_scripts', 'ipython')()
)
Aha - open /usr/local/bin/ipython in your editor (with privileges), and change the first line to #!/usr/local/bin/python
save, start iPython, should say it's using 2.7.2 now.
同样的solution, 对于ipython3
(尤其当python3.4 转成了3.5之后)
|