Any fix for wxAgg on Mac?

Russell E. Owen wrote:

I reinstalled wxPython 2.7 from the package at pythonmac.org (to be paranoid). I'm using the Python 2.5 version.

check

I got wx-config on my path and confirmed it's the right one (see below for details).

check.

Now when I try to build matplotlib it fails. Ouch.

It starts out with the same warning as last time:
setup.py:267: DeprecationWarning: The wxPython compatibility package is no longer automatically generated or activly maintained. Please switch to the wx package as soon as possible.
  import wxPython

This one is easy!

In setup.py, replace:

import wxPython

with

import wx

A few versions ago, the "import wxPython" form was deprecated -- it is now gone in 2.7. IN this case, all it's doing it checking if wxPython is installed, so th import wx should be the only change needed.

A quick search revealed that the back-end itself has been switched over already.

-Chris

PS: you haven't been sending your notes to the list.

···

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...

Got it. Thanks! Should I submit a patch?

Unfortunately "python setup.py build" still fails when compiling _wxagg (in the same way as last time). I've appended the log so the whole list can enjoy it.

I should probably be using wxPython 2.6.x. I originally thought wxPython 2.7 was the current release but as you pointed out, that was a misconception. Unfortunately, it's the only binary package available for Python 2.5 at pythonmac.org.

-- Russell

$ python setup.py build
GTK requires pygtk
GTKAgg requires pygtk
running build
running build_py
running build_ext
building 'matplotlib.backends._wxagg' extension
C compiler: gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3

creating build/temp.macosx-10.3-fat-2.5
creating build/temp.macosx-10.3-fat-2.5/src
creating build/temp.macosx-10.3-fat-2.5/CXX
compile options: '-D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -D__WXMAC__ -I/usr/local/include -I/usr/include -I. -Isrc -Iswig -Iagg23/include -I. -I/usr/local/include -I/usr/include -I. -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I./freetype2 -Isrc/freetype2 -Iswig/freetype2 -Iagg23/include/freetype2 -I./freetype2 -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I./freetype2 -I/usr/local/include -I/usr/include -I. -I/usr/local/lib/wxPython-unicode-2.7.1.3/lib/wx/include/mac-unicode-debug-2.7 -I/usr/local/lib/wxPython-unicode-2.7.1.3/include/wx-2.7 -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c'
gcc: CXX/cxxextensions.c
gcc: CXX/cxx_extensions.cxx
gcc: CXX/IndirectPythonInterface.cxx
gcc: src/_wxagg.cpp
src/_wxagg.cpp: In function 'wxBitmap* convert_agg2bitmap(RendererAgg*, Bbox*)':
src/_wxagg.cpp:238: error: conversion from 'wxImage*' to 'const wxString' is ambiguous
/usr/local/lib/wxPython-unicode-2.7.1.3/include/wx-2.7/wx/string.h:686: note: candidates are: wxString::wxString(wxChar, size_t) <near match>
/usr/local/lib/wxPython-unicode-2.7.1.3/include/wx-2.7/wx/string.h:676: note: wxString::wxString(int) <near match>
src/_wxagg.cpp: In function 'wxBitmap* convert_agg2bitmap(RendererAgg*, Bbox*)':
src/_wxagg.cpp:238: error: conversion from 'wxImage*' to 'const wxString' is ambiguous
/usr/local/lib/wxPython-unicode-2.7.1.3/include/wx-2.7/wx/string.h:686: note: candidates are: wxString::wxString(wxChar, size_t) <near match>
/usr/local/lib/wxPython-unicode-2.7.1.3/include/wx-2.7/wx/string.h:676: note: wxString::wxString(int) <near match>
lipo: can't figure out the architecture type of: /var/tmp//cc135E90.out
src/_wxagg.cpp: In function 'wxBitmap* convert_agg2bitmap(RendererAgg*, Bbox*)':
src/_wxagg.cpp:238: error: conversion from 'wxImage*' to 'const wxString' is ambiguous
/usr/local/lib/wxPython-unicode-2.7.1.3/include/wx-2.7/wx/string.h:686: note: candidates are: wxString::wxString(wxChar, size_t) <near match>
/usr/local/lib/wxPython-unicode-2.7.1.3/include/wx-2.7/wx/string.h:676: note: wxString::wxString(int) <near match>
src/_wxagg.cpp: In function 'wxBitmap* convert_agg2bitmap(RendererAgg*, Bbox*)':
src/_wxagg.cpp:238: error: conversion from 'wxImage*' to 'const wxString' is ambiguous
/usr/local/lib/wxPython-unicode-2.7.1.3/include/wx-2.7/wx/string.h:686: note: candidates are: wxString::wxString(wxChar, size_t) <near match>
/usr/local/lib/wxPython-unicode-2.7.1.3/include/wx-2.7/wx/string.h:676: note: wxString::wxString(int) <near match>
lipo: can't figure out the architecture type of: /var/tmp//cc135E90.out
error: Command "gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -D__WXMAC__ -I/usr/local/include -I/usr/include -I. -Isrc -Iswig -Iagg23/include -I. -I/usr/local/include -I/usr/include -I. -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I./freetype2 -Isrc/freetype2 -Iswig/freetype2 -Iagg23/include/freetype2 -I./freetype2 -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I./freetype2 -I/usr/local/include -I/usr/include -I. -I/usr/local/lib/wxPython-unicode-2.7.1.3/lib/wx/include/mac-unicode-debug-2.7 -I/usr/local/lib/wxPython-unicode-2.7.1.3/include/wx-2.7 -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c src/_wxagg.cpp -o build/temp.macosx-10.3-fat-2.5/src/_wxagg.o" failed with exit status 1

···

At 2:38 PM -0800 2006-11-08, Christopher Barker wrote:

Russell E. Owen wrote:

I reinstalled wxPython 2.7 from the package at pythonmac.org (to be paranoid). I'm using the Python 2.5 version.

check

I got wx-config on my path and confirmed it's the right one (see below for details).

check.

Now when I try to build matplotlib it fails. Ouch.

It starts out with the same warning as last time:
setup.py:267: DeprecationWarning: The wxPython compatibility package is no longer automatically generated or activly maintained. Please switch to the wx package as soon as possible.
  import wxPython

This one is easy!

In setup.py, replace:

import wxPython

with

import wx

A few versions ago, the "import wxPython" form was deprecated -- it is now gone in 2.7. IN this case, all it's doing it checking if wxPython is installed, so th import wx should be the only change needed.

Russell E Owen wrote:

I should probably be using wxPython 2.6.x. I originally thought wxPython 2.7 was the current release but as you pointed out, that was a misconception. Unfortunately, it's the only binary package available for Python 2.5 at pythonmac.org.

There is a binary of wxPython 2.6 for Python2.5 at:

http://www.wxpython.org/download-2.6.3.3.php

Maybe I'll ask Bob to put that up on pythonmac -- the 2.7 one is out of date already anyway. Let me know how it works.

-CHB

···

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...

I just tried to compile MPL with wxPython 2.7 -- and remembered why I
hadn't done it in a while -- I don't have Universal version of libpng
and libfreetype, and I don't know how to make or have the time to figure
it out.

I would be happy to send them to you if you want them.

Maybe wxPython 2.6 will work for you -- let's hope so.

It did. Thanks!

I initially had wx-config pointing to the wrong place (probably the version for Python 2.4) so had some "interesting" errors, but I threw some stuff out and corrected the problem and all was well.

Otherwise, Charlie Moad was building binaries -- I wonder what's become of him?

I may probably just got in first this time. I was keen to upgrade to python 2.5.

Anyway, I suppose my time would be better spent improving the non-accelerated version -- I don't think it's really necessary and it would make all this a lot easier!

Sounds like a good bet. Though I also really like your idea of making the setup.py file smart enough to find the right wx-config. That would be a good quick fix (at least I think it would be quick) and would make building a lot more robust.

Thank you again for all your help. I see you even found a fix for wxPython 2.7. I don't plan to try myself because I've got something that works, but it sounds like a good bug to fix!

With any luck Bob Ippolito will have the improved matplotlib installer available soon at pythonmac.org.

Regards,

-- Russell

···

At 4:10 PM -0800 2006-11-08, Christopher Barker wrote: