看起来你的Python 2.6安装是通过MacPorts,基于/opt/local
前缀。如果您没有使用MacPorts安装它并且有自己的使用理由/opt/local
,请忽略此答案。如果你这样做,你可以安装ipython port
。
port install py26-ipython
确保将$PATH
环境变量设置为include /opt/local/bin
。这应该由MacPorts安装程序完成。我~/.profile
看起来像:
# MacPorts Installer addition on 2009-03-05_at_21:11:52: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.
# MacPorts Installer addition on 2009-03-05_at_21:11:52: adding an appropriate MANPATH variable for use with MacPorts.
export MANPATH=/opt/local/share/man:$MANPATH
# Finished adapting your MANPATH environment variable for use with MacPorts.
我会小心地将easy_install与MacPorts python结合使用,特别是对于MacPorts已经提供的模块。例如,MacPorts ipython将可执行文件放在/opt/local/bin/ipython2.6
一起/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/ipython
编辑
要卸载easy_installed版本的ipython,据我所知,您需要手动删除相关文件。我根据我的ipython安装进行了一次飞跃。首先删除可执行文件:
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/ipcluster
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/ipcontroller
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/ipengine
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/iptest
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/ipython
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/ipython-wx
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/ipythonx
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/irunner
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/pycolor
然后,删除site-packages中的文件夹和egg-info:
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/IPython/
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ipython-0.10-py2.6.egg-info
然后,删除doc文件夹:
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/share/doc/ipython/
然后,删除man文件:
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/share/man/man1/ipcluster.1.gz
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/share/man/man1/ipcontroller.1.gz
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/share/man/man1/ipengine.1.gz
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/share/man/man1/ipython-wx.1.gz
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/share/man/man1/ipython.1.gz
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/share/man/man1/ipythonx.1.gz
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/share/man/man1/irunner.1.gz
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/share/man/man1/pycolor.1.gz
最后,打开文件/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/easy-install.pth
,查看是否有引用ipython egg的行。删除它。
iPython
使用的东西easy_install
。一位朋友在11月左右安装了使用MacPorts安装的Python 2.6.4。我认为他设置它使得我可以在终端上运行Python而不深入研究/opt/local/bin
- 这是否有意义我可以在终端中键入并运行python因为那样?是的,我对这个Unix / Linux / MacOSX的东西还很绿......