English 中文(简体)
Install MatPlotLib 1.2.x on OS X狮 10.7.4和3.2.2
原标题:Install MatPlotLib 1.2.x on OS X Lion 10.7.4 and Python 3.2.2

几天前,我就同一系统安装 n提出了问题。 幸亏,我设法解决了这个问题,但不幸的是,我现在在努力安装平衡。

首先,我尝试了目前的分发版本,但没有这样做。 因此,我认为,我会下载盖特存放处,并尝试这样做。 我已经谈到这一点:

  • changed the make.osx file so that it will work in Python 3:
    • import urllib -> import urllib.request
    • urllib.urlretrieve() -> urllib.request.urlretrieve()

即便是在这之后,我仍没有找到自由型2头盔。 我环绕并发现,我可以通过编辑<条码>顶版<<>py的一条线来解决这一问题:

  • darwin : [], -> darwin : [ /usr/local ],

然而,在使用<代码>make.osx文档时,我仍然收到错误信息。 在这里,我是如何从码头上提案的:

  • sudo make -f make.osx PREFIX=/usr/local PYVERSION=3.2 fetch deps mpl_build mpl_install

我知道,Thur3号正式支持了结晶吗? 但我认为,至少在某个地方,也许有人会设法汇编/储存吗?

任何帮助都将受到高度赞赏。

Adam.

我列入了以下错误:

basedirlist is: [ /usr/local ]
============================================================================
BUILDING MATPLOTLIB
            matplotlib: 1.2.x
                python: 3.2.2 (v3.2.2:137e45f15c0b, Sep  3 2011, 17:28:59)
                        [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
              platform: darwin

REQUIRED DEPENDENCIES
                 numpy: 1.6.2rc1
             freetype2: found, but unknown version (no pkg-config)

OPTIONAL BACKEND DEPENDENCIES
                libpng: found, but unknown version (no pkg-config)
               Tkinter: Tkinter: version not identified, Tk: 8.5, Tcl: 8.5
                  Gtk+: no
                        * Building for Gtk+ requires pygtk; you must be able
                        * to "import gtk" in your build/install environment
       Mac OS X native: yes
                    Qt: no
                   Qt4: Qt: 4.7.4, PyQt4: 4.8.6
                PySide: no
                 Cairo: no

OPTIONAL DATE/TIMEZONE DEPENDENCIES
              datetime: present, version unknown
              dateutil: matplotlib will provide
                  pytz: matplotlib will provide
adding pytz

OPTIONAL USETEX DEPENDENCIES
                dvipng: no
           ghostscript: /bin/sh: gs: command not found
                 latex: no

[Edit setup.cfg to suppress the above messages]
============================================================================
pymods [ pylab ]
packages [ matplotlib ,  matplotlib.backends ,  matplotlib.backends.qt4_editor ,  matplotlib.projections ,  matplotlib.testing ,  matplotlib.testing.jpl_units ,  matplotlib.tests ,  mpl_toolkits ,  mpl_toolkits.mplot3d ,  mpl_toolkits.axes_grid ,  mpl_toolkits.axes_grid1 ,  mpl_toolkits.axisartist ,  matplotlib.sphinxext ,  matplotlib.tri ,  matplotlib.delaunay ,  pytz ,  dateutil ,  dateutil.zoneinfo ]
running build
running build_py
copying lib/matplotlib/mpl-data/matplotlibrc -> build/lib.macosx-10.6-intel-3.2/matplotlib/mpl-data
copying lib/matplotlib/mpl-data/matplotlib.conf -> build/lib.macosx-10.6-intel-3.2/matplotlib/mpl-data

running build_ext
building  matplotlib.ft2font  extension
gcc-4.2 -DNDEBUG -g -O3 -arch i386 -arch x86_64 -I/usr/local/include -I/usr/local/include/freetype2 -isysroot /Developer/SDKs/MacOSX10.6.sdk -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -DPYCXX_PYTHON_2TO3=1 -I/usr/local/include -I/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/numpy/core/include -I/usr/local/include -I. -I/usr/local/include/freetype2 -I/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/numpy/core/include/freetype2 -I/usr/local/include/freetype2 -I./freetype2 -I/Library/Frameworks/Python.framework/Versions/3.2/include/python3.2m -c src/ft2font.cpp -o build/temp.macosx-10.6-intel-3.2/src/ft2font.o
In file included from /Library/Frameworks/Python.framework/Versions/3.2/include/python3.2m/bytearrayobject.h:9,
                 from /Library/Frameworks/Python.framework/Versions/3.2/include/python3.2m/Python.h:73,
                 from ./CXX/WrapPython.h:58,
                 from ./CXX/Extensions.hxx:37,
                 from src/ft2font.h:6,
                 from src/ft2font.cpp:3:
/Developer/SDKs/MacOSX10.6.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory
In file included from /Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/iosfwd:45,
                 from /Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:70,
                 from /Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/bits/char_traits.h:46,
                 from /Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/string:47,
                 from ./CXX/Python3/Exception.hxx:47,
                 from ./CXX/Python3/Objects.hxx:45,
                 from ./CXX/Python3/Extensions.hxx:52,
                 from ./CXX/Extensions.hxx:42,
                 from src/ft2font.h:6,
                 from src/ft2font.cpp:3:
/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/i686-apple-darwin11/bits/c++locale.h: In function ‘int std::__convert_from_v(int* const&, char*, int, const char*, ...)’:
/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/i686-apple-darwin11/bits/c++locale.h:77: error: ‘va_start’ was not declared in this scope
/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/i686-apple-darwin11/bits/c++locale.h:85: error: ‘va_end’ was not declared in this scope
In file included from /Library/Frameworks/Python.framework/Versions/3.2/include/python3.2m/bytearrayobject.h:9,
                 from /Library/Frameworks/Python.framework/Versions/3.2/include/python3.2m/Python.h:73,
                 from ./CXX/WrapPython.h:58,
                 from ./CXX/Extensions.hxx:37,
                 from src/ft2font.h:6,
                 from src/ft2font.cpp:3:
/Developer/SDKs/MacOSX10.6.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory
In file included from /Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/iosfwd:45,
                 from /Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:70,
                 from /Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/bits/char_traits.h:46,
                 from /Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/string:47,
                 from ./CXX/Python3/Exception.hxx:47,
                 from ./CXX/Python3/Objects.hxx:45,
                 from ./CXX/Python3/Extensions.hxx:52,
                 from ./CXX/Extensions.hxx:42,
                 from src/ft2font.h:6,
                 from src/ft2font.cpp:3:
/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/i686-apple-darwin11/x86_64/bits/c++locale.h: In function ‘int std::__convert_from_v(int* const&, char*, int, const char*, ...)’:
/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/i686-apple-darwin11/x86_64/bits/c++locale.h:77: error: ‘va_start’ was not declared in this scope
/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/i686-apple-darwin11/x86_64/bits/c++locale.h:85: error: ‘va_end’ was not declared in this scope
lipo: can t figure out the architecture type of: /var/tmp//ccafJH1l.out
error: command  gcc-4.2  failed with exit status 1
make: *** [mpl_build] Error 1
最佳回答

Okay...I认为,现在安装了matplotlib

  1. 首先,需要安装numpy。 我已指示在另一个职位上这样做:

  2. Now open Terminal and clone the git repository for matplotlib (assumes you have git installed):

    • git clone git://github.com/matplotlib/matplotlib.git (this might take a while)
  3. 页: 1

  4. In your user folder open the matplotlib directory

  5. 有一个名为“make.osx”的档案,上面有TextEdit(或类似)

  6. 修改如下内容:

    • MACOSX_DEPLOYMENT_TARGET=10.6
    • OSX_SDK_VER=10.6

    :

    • MACOSX_DEPLOYMENT_TARGET=10.7
    • OSX_SDK_VER=10.7
  7. 修改如下内容:

    • ${PYTHON} -c import urllib; urllib.urlretrieve("${ZLIBURL}", "${ZLIBFILE}") && ${PYTHON} -c import urllib; urllib.urlretrieve("${PNGURL}", "${PNGFILE}") && ${PYTHON} -c import urllib; urllib.urlretrieve("${FREETYPEURL}", "${FREETYPEFILE}")

    :

    • ${PYTHON} -c import urllib.request; urllib.request.urlretrieve("${ZLIBURL}", "${ZLIBFILE}") && ${PYTHON} -c import urllib.request; urllib.request.urlretrieve("${PNGURL}", "${PNGFILE}") && ${PYTHON} -c import urllib.request; urllib.request.urlretrieve("${FREETYPEURL}", "${FREETYPEFILE}")
  8. 改变

  9. 开放文件setupext.py,idle

  10. Find the line darwin : [], and change it to darwin : [/usr/ local],

  11. Save the file

  12. 开放式<>Terminal ,并重述如下:

    • sudo make -f make.osx PREFIX=/usr/local PYVERSION=3.2 fetch deps mpl_build mpl_install
  13. 在经过一段时间后,应在以下名录内安装校正:

    • /usr/local/lib/Python3.2/site-packages/
  14. Open the above directory and also the following directory:

    • /Library/Python/3.2/site-packages/
  15. http://www.un.org/Depts/DGACM/index_french.htm

    • dateutil
    • matplotlib
    • mpl_toolkits
  16. matplotlib should be now installed

  17. 如果您开放idle <>/strong>和import matplotlib,应退还错误

  18. 我尝试了matplotlib/examples/user_interfaces/embetions_in_qt4_wtoolbar.py。 档案看来是罚款。

希望其他人认为这有用!

再次感谢援助,

Adam。

问题回答

暂无回答




相关问题
Get webpage contents with Python?

I m using Python 3.1, if that helps. Anyways, I m trying to get the contents of this webpage. I Googled for a little bit and tried different things, but they didn t work. I m guessing that this ...

What is internal representation of string in Python 3.x

In Python 3.x, a string consists of items of Unicode ordinal. (See the quotation from the language reference below.) What is the internal representation of Unicode string? Is it UTF-16? The items ...

What does Python s builtin __build_class__ do?

In Python 3.1, there is a new builtin function I don t know in the builtins module: __build_class__(...) __build_class__(func, name, *bases, metaclass=None, **kwds) -> class Internal ...

what functional tools remain in Python 3k?

I have have read several entries regarding dropping several functional functions from future python, including map and reduce. What is the official policy regarding functional extensions? is lambda ...

Building executables for Python 3 and PyQt

I built a rather simple application in Python 3.1 using PyQt4. Being done, I want the application to be distributed to computers without either of those installed. I almost exclusively care about ...