正如@Bogdan 所提到的,修复它的方法是使用 pip。
此处描述了设置 pip 的方法:http://docs.python-guide.org/en/latest/starting/install/linux/#install-linux总结为:
(我认为 python-distribute 预装在 13.10 中,但检查一下也无妨)
sudo apt-get install python-distribute
然后我们正确设置python环境:
sudo easy_install pip
sudo pip install virtualenv
之后,执行:
sudo pip install ipython[all]
这将让 pip 处理 ipython 列出的依赖项。至此,IPython 已经可以正常工作了。
可选,安装 matplotlib 和 numpy:
这些负责 matplotlib 和 numpy 的依赖项(假设您已经正确安装了 LaTeX):
apt-get install libfreetype6-dev libpng-dev libpython-all-dev gcc gfortran dvipdf
部分参考:安装 matplotlib 时出错
我的目标是这样的:
============================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [1.3.1]
python: yes [2.7.5+ (default, Sep 19 2013, 13:49:51) [GCC
4.8.1]]
platform: yes [linux2]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.7.1]
dateutil: yes [using dateutil version 2.1]
tornado: yes [using tornado version 3.1.1]
pyparsing: yes [using pyparsing version 2.0.1]
pycxx: yes [Couldn't import. Using local copy.]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
freetype: yes [version 16.1.10]
png: yes [version 1.2.49]
OPTIONAL SUBPACKAGES
sample_data: yes [installing]
toolkits: yes [installing]
tests: yes [using nose version 1.3.0]
OPTIONAL BACKEND EXTENSIONS
macosx: no [Mac OS-X only]
qt4agg: yes [installing, Qt: 4.8.4, PyQt4: 4.10.3]
gtk3agg: yes [installing, version 3.4.8]
gtk3cairo: yes [installing, version 3.4.8]
gtkagg: no [The C/C++ header for gtk (gtk/gtk.h) could not
be found. You may need to install the development
package.]
tkagg: no [The C/C++ header for Tk (tk.h) could not be
found. You may need to install the development
package.]
wxagg: no [requires wxPython]
gtk: no [The C/C++ header for gtk (gtk/gtk.h) could not
be found. You may need to install the development
package.]
agg: yes [installing]
cairo: yes [installing, version 1.8.8]
windowing: no [Microsoft Windows only]
OPTIONAL LATEX DEPENDENCIES
dvipng: yes [version 1.14]
ghostscript: yes [version 9.10]
latex: yes [version 3.1415926]
pdftops: yes [version 0.24.1]
所以,如果我错过了任何依赖项,请在下面评论;)
然后,使用 pip:
sudo pip install matplotlib[all]
它编译并完成。Ipython、numpy 和 matplotlib 已准备好在 Ubuntu 13.10 中用于科学。