wxPython-2.8 problems

Hi,

I am having problems installing matplotlib-0.90.0 under Mac OS X (using MacPorts) when having wxPython-2.8.4.0 installed, getting the following error at build-time:

DEBUG: Assembled command: 'cd "/opt/local/var/db/dports/build/_Users_jochen_source_macports-trunk_dports_python_py-matplotlib/work/matplotlib-0.90.0" && /opt/local/bin/python2.4 setup.py build'
setup.py:267: DeprecationWarning: The wxPython compatibility package is no longer automatically generated or actively maintained. Please switch to the wx package as soon as possible.
   import wxPython
/opt/local/lib/python2.4/site-packages/wx-2.8-mac-unicode/wx/_core.py:13967: UserWarning: wxPython/wxWidgets release number mismatch
   warnings.warn("wxPython/wxWidgets release number mismatch")
WXAgg's accelerator requires wxPython
running build

Nevertheless, matplotlib builds, but bails out with

> python
Python 2.4.4 (#1, May 8 2007, 21:00:03)
[GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pylab
/opt/local/lib/python2.4/site-packages/wx-2.8-mac-unicode/wx/_core.py:13967: UserWarning: wxPython/wxWidgets release number mismatch
   warnings.warn("wxPython/wxWidgets release number mismatch")
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File "/opt/local/lib/python2.4/site-packages/pylab.py", line 1, in ?
     from matplotlib.pylab import *
   File "/opt/local/lib/python2.4/site-packages/matplotlib/pylab.py", line 222, in ?
     new_figure_manager, draw_if_interactive, show = pylab_setup()
   File "/opt/local/lib/python2.4/site-packages/matplotlib/backends/__init__.py", line 24, in pylab_setup
     globals(),locals(),[backend_name])
   File "/opt/local/lib/python2.4/site-packages/matplotlib/backends/backend_wxagg.py", line 19, in ?
     import wx
   File "/opt/local/lib/python2.4/site-packages/wx-2.8-mac-unicode/wx/__init__.py", line 45, in ?
     from wx._core import *
   File "/opt/local/lib/python2.4/site-packages/wx-2.8-mac-unicode/wx/_core.py", line 14007, in ?
     default = locale.getpreferredencoding()
   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/locale.py", line 399, in getpreferredencoding
     import _locale
ImportError: No module named _locale

Again, a release number mismatch;
but then there is also the
   import _locale
error.

With respect to matplotlib I have now resorted to install it with GTKAGG, which works as expected.

For wxPython: I get the same error when trying to import wxpython or wx directly in a fresh python:

> python -E
Python 2.4.4 (#1, May 8 2007, 21:00:03)
[GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
/opt/local/lib/python2.4/site-packages/wx-2.8-mac-unicode/wx/_core.py:13967: UserWarning: wxPython/wxWidgets release number mismatch
   warnings.warn("wxPython/wxWidgets release number mismatch")
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File "/opt/local/lib/python2.4/site-packages/wx-2.8-mac-unicode/wx/__init__.py", line 45, in ?
     from wx._core import *
   File "/opt/local/lib/python2.4/site-packages/wx-2.8-mac-unicode/wx/_core.py", line 14007, in ?
     default = locale.getpreferredencoding()
   File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/locale.py", line 399, in getpreferredencoding
     import _locale
ImportError: No module named _locale
>>>

Is this a known issue?
Is there an easy way around ?
Is there any other information I should send?

Greetings,
Jochen

PGP.sig (186 Bytes)

···

--
Einigkeit und Recht und Freiheit http://www.Jochen-Kuepper.de
     Liberté, Égalité, Fraternité GnuPG key: CC1B0B4D
         Sex, drugs and rock-n-roll

First:

Please don't cross-post quite so much!

Second:

there are some issues with building MPL against wxPython, but it looks like you've got wxPython problems anyway -- so you need to resolve those first. The macports or wxPython lists are your best bet for that.

For wxPython: I get the same error when trying to import wxpython or wx directly in a fresh python:

UserWarning: wxPython/wxWidgets release number mismatch
  warnings.warn("wxPython/wxWidgets release number mismatch")

wxPython was built against a particular version of wxWidgets -- I suspect you've got more than one version of wxWidgets on there, and it's finding the wrong one. I don't use macports, so I'm not sure how it should be set up, but I'd look for files starting with "lib_wx", and see what versions you find.

Or just go back and re-install wxPython, making sure you follow all the steps correctly -- how did you did that in the first place?

-Chris

PS: this will probably be easier if you use the macpython version of python/wxpython/MPL -- do you need macports for a reason?

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...

Please don't cross-post quite so much!

My apologies for make so much fuzz about this!
(But is a posting to two mailing lists really posted too wide?)

there are some issues with building MPL against wxPython, but it looks
like you've got wxPython problems anyway -- so you need to resolve those
first. The macports or wxPython lists are your best bet for that.

There were actually problems with the MacPorts python-2.4 port, which re resolved by now. The details are given here:
   http://trac.macports.org/projects/macports/changeset/25391

wxPython was built against a particular version of wxWidgets -- I
suspect you've got more than one version of wxWidgets on there,

Well, no.
Maybe MacPorts updated wxPython before wxWidgets, but in principle that should not (and normally does not) happen either.

Or just go back and re-install wxPython, making sure you follow all the
steps correctly -- how did you did that in the first place?

MacPorts does it for me;)

PS: this will probably be easier if you use the macpython version of
python/wxpython/MPL -- do you need macports for a reason?

Yes, it gives me all the Unix tools I need from a single place and in a very clean way, including dependency tracking and clean uninstalls or upgrades...

Anyway, thank you very much for your suggestions.

A big thank you to everybody who has contributed to matplotlib and wxWidgets/wxPython for great products!

Greetings,
Jochen

PGP.sig (186 Bytes)

···

On 21.05.2007, at 19:55, Christopher Barker wrote:
--
Einigkeit und Recht und Freiheit http://www.Jochen-Kuepper.de
     Liberté, Égalité, Fraternité GnuPG key: CC1B0B4D
         Sex, drugs and rock-n-roll