Discussion:
[GRASSGUI] wxgrass does not see wx on import
Yann
2007-11-14 22:56:50 UTC
Permalink
Hi,

System: Debian unstable (from Kanotix originally)

- installed wxgtk2.6, had a problem, wxgrass could not find wx.combo.

- compiled from source wxpython2.8.0
(./configure --prefix=/usr --enable-combobox --with-gtk --with-gnomeprint --with-opengl --enable-geometry --enable-display ;
make ; make install)

- wxgrass does not find wx
-----------------------------------------------------------------
GRASS 6.3.cvs (biwago):~ > wxgrass
Traceback (most recent call last):
File "/usr/local/grass-6.3.cvs/etc/wx/wxgui.py", line 11, in ?
import wx
ImportError: No module named wx
----------------------------------------------------------------

Anybody can tell me the missing link to make the new wx visible to python?

Thank you,
Yann
--
Yann Chemin
Sainte-Anne d'Auray, France
Daniel Calvelo
2007-11-14 22:56:50 UTC
Permalink
Try to

export PYTHONPATH=/path/to/your/local/copy/of/wxPython

before running wxgrass.

Daniel.

BTW if under Debian, try to add this to /etc/apt/sources.list :

deb http://wxpython.wxcomunity.com/apt/ubuntu/dapper /

It works perfectly for me under Debian unstable.
Post by Yann
Hi,
System: Debian unstable (from Kanotix originally)
- installed wxgtk2.6, had a problem, wxgrass could not find wx.combo.
- compiled from source wxpython2.8.0
(./configure --prefix=/usr --enable-combobox --with-gtk --with-gnomeprint --with-opengl --enable-geometry --enable-display ;
make ; make install)
- wxgrass does not find wx
-----------------------------------------------------------------
GRASS 6.3.cvs (biwago):~ > wxgrass
File "/usr/local/grass-6.3.cvs/etc/wx/wxgui.py", line 11, in ?
import wx
ImportError: No module named wx
----------------------------------------------------------------
Anybody can tell me the missing link to make the new wx visible to python?
Thank you,
Yann
--
Yann Chemin
Sainte-Anne d'Auray, France
_______________________________________________
grassgui mailing list
http://grass.itc.it/mailman/listinfo/grassgui
--
-- Daniel Calvelo Aros
Yann
2007-11-14 22:56:50 UTC
Permalink
Added to /etc/apt/sources.list :

# wxPython APT repository at wxcommunity.com
deb http://wxpython.wxcommunity.com/apt/ubuntu/dapper /
deb-src http://wxpython.wxcommunity.com/apt/ubuntu/dapper /

aptitude update && aptitude install python-wxgtk2.8 python-wxtools
python-wxaddons wx2.8-i18n -y

Worked fine under Debian unstable.
Post by Daniel Calvelo
deb http://wxpython.wxcomunity.com/apt/ubuntu/dapper /
--
Yann Chemin
Sainte-Anne d'Auray, France
Brad Douglas
2007-11-14 22:56:50 UTC
Permalink
I had similar problems after installing the RPMs I built, but I got a
bit further until it complained about a specific 'widget'. I traced it
back to a requirement on python-2.5+ (that's how it appeared). Please
correct me if I'm wrong because I'd really like to get this working with
GRASS[1].

[1] I can't upgrade python without upgrading to an unstable development
version of the OS due to massive dependencies. Not something I want to
do and still be able to build GRASS RPMs reliably.
Post by Yann
Hi,
System: Debian unstable (from Kanotix originally)
- installed wxgtk2.6, had a problem, wxgrass could not find wx.combo.
- compiled from source wxpython2.8.0
(./configure --prefix=/usr --enable-combobox --with-gtk --with-gnomeprint --with-opengl --enable-geometry --enable-display ;
make ; make install)
- wxgrass does not find wx
-----------------------------------------------------------------
GRASS 6.3.cvs (biwago):~ > wxgrass
File "/usr/local/grass-6.3.cvs/etc/wx/wxgui.py", line 11, in ?
import wx
ImportError: No module named wx
----------------------------------------------------------------
Anybody can tell me the missing link to make the new wx visible to python?
--
Brad Douglas <rez touchofmadness com> KB8UYR/6
Address: 37.493,-121.924 / WGS84 National Map Corps #TNMC-3785
Daniel Calvelo
2007-11-14 22:56:50 UTC
Permalink
Brad,

Which widget was it? If it's part of the contrib widgets in wx2.8,
that's manageable.

Did you try setting PYTHONPATH with a hand-compiled version of wxpython?

Daiel.
Post by Brad Douglas
I had similar problems after installing the RPMs I built, but I got a
bit further until it complained about a specific 'widget'. I traced it
back to a requirement on python-2.5+ (that's how it appeared). Please
correct me if I'm wrong because I'd really like to get this working with
GRASS[1].
[1] I can't upgrade python without upgrading to an unstable development
version of the OS due to massive dependencies. Not something I want to
do and still be able to build GRASS RPMs reliably.
Post by Yann
Hi,
System: Debian unstable (from Kanotix originally)
- installed wxgtk2.6, had a problem, wxgrass could not find wx.combo.
- compiled from source wxpython2.8.0
(./configure --prefix=/usr --enable-combobox --with-gtk --with-gnomeprint --with-opengl --enable-geometry --enable-display ;
make ; make install)
- wxgrass does not find wx
-----------------------------------------------------------------
GRASS 6.3.cvs (biwago):~ > wxgrass
File "/usr/local/grass-6.3.cvs/etc/wx/wxgui.py", line 11, in ?
import wx
ImportError: No module named wx
----------------------------------------------------------------
Anybody can tell me the missing link to make the new wx visible to python?
--
Brad Douglas <rez touchofmadness com> KB8UYR/6
Address: 37.493,-121.924 / WGS84 National Map Corps #TNMC-3785
_______________________________________________
grassgui mailing list
http://grass.itc.it/mailman/listinfo/grassgui
--
-- Daniel Calvelo Aros
Brad Douglas
2007-11-14 22:56:50 UTC
Permalink
Post by Daniel Calvelo
Brad,
Which widget was it? If it's part of the contrib widgets in wx2.8,
that's manageable.
Here's the exact error:

GRASS 6.3.cvs (utm10):/usr/src/grass63 > wxgrass
Traceback (most recent call last):
File "/opt/gis/grass-6.3.cvs/etc/wx/wxgui.py", line 16, in ?
import wx.richtext
File
"/usr/lib64/python2.4/site-packages/wx-2.8-gtk2-unicode/wx/richtext.py",
line 4, in ?
import _richtext
ImportError: /usr/lib64/python2.4/site-packages/wx-2.8-gtk2-unicode/wx/_richtext.so: undefined symbol: wxEVT_COMMAND_RICHTEXT_CHARACTER

This is what led me to believe it was a python2.5 symbol, but I'm
relatively inexperienced with wxpython. There are also no unresolved
libraries linked to _richtext.so.
Post by Daniel Calvelo
Did you try setting PYTHONPATH with a hand-compiled version of wxpython?
I shouldn't have to, but I did it anyway to make sure. No dice. :(
Post by Daniel Calvelo
Post by Brad Douglas
I had similar problems after installing the RPMs I built, but I got a
bit further until it complained about a specific 'widget'. I traced it
back to a requirement on python-2.5+ (that's how it appeared). Please
correct me if I'm wrong because I'd really like to get this working with
GRASS[1].
[1] I can't upgrade python without upgrading to an unstable development
version of the OS due to massive dependencies. Not something I want to
do and still be able to build GRASS RPMs reliably.
--
Brad Douglas <rez touchofmadness com> KB8UYR/6
Address: 37.493,-121.924 / WGS84 National Map Corps #TNMC-3785
Glynn Clements
2007-11-14 22:56:50 UTC
Permalink
Post by Brad Douglas
Post by Daniel Calvelo
Brad,
Which widget was it? If it's part of the contrib widgets in wx2.8,
that's manageable.
GRASS 6.3.cvs (utm10):/usr/src/grass63 > wxgrass
File "/opt/gis/grass-6.3.cvs/etc/wx/wxgui.py", line 16, in ?
import wx.richtext
File
"/usr/lib64/python2.4/site-packages/wx-2.8-gtk2-unicode/wx/richtext.py",
line 4, in ?
import _richtext
ImportError: /usr/lib64/python2.4/site-packages/wx-2.8-gtk2-unicode/wx/_richtext.so: undefined symbol: wxEVT_COMMAND_RICHTEXT_CHARACTER
This is what led me to believe it was a python2.5 symbol, but I'm
relatively inexperienced with wxpython. There are also no unresolved
libraries linked to _richtext.so.
It should be in libwx_gtk2ud_richtext-2.8.so
Post by Brad Douglas
Post by Daniel Calvelo
Did you try setting PYTHONPATH with a hand-compiled version of wxpython?
I shouldn't have to, but I did it anyway to make sure. No dice. :(
Are the wx 2.8 libraries visible (ld.so.conf or $LD_LIBRARY_PATH)?
--
Glynn Clements <***@gclements.plus.com>
Brad Douglas
2007-11-14 22:56:50 UTC
Permalink
Post by Glynn Clements
Post by Brad Douglas
Post by Daniel Calvelo
Which widget was it? If it's part of the contrib widgets in wx2.8,
that's manageable.
GRASS 6.3.cvs (utm10):/usr/src/grass63 > wxgrass
File "/opt/gis/grass-6.3.cvs/etc/wx/wxgui.py", line 16, in ?
import wx.richtext
File
"/usr/lib64/python2.4/site-packages/wx-2.8-gtk2-unicode/wx/richtext.py",
line 4, in ?
import _richtext
ImportError: /usr/lib64/python2.4/site-packages/wx-2.8-gtk2-unicode/wx/_richtext.so: undefined symbol: wxEVT_COMMAND_RICHTEXT_CHARACTER
This is what led me to believe it was a python2.5 symbol, but I'm
relatively inexperienced with wxpython. There are also no unresolved
libraries linked to _richtext.so.
It should be in libwx_gtk2ud_richtext-2.8.so
Post by Brad Douglas
Post by Daniel Calvelo
Did you try setting PYTHONPATH with a hand-compiled version of wxpython?
I shouldn't have to, but I did it anyway to make sure. No dice. :(
Are the wx 2.8 libraries visible (ld.so.conf or $LD_LIBRARY_PATH)?
The wx libraries reside in /usr/lib64, so I would be rather surprised if
they weren't in the LD path. :-)

I have a better idea of what I'm looking for, so I'll rebuild the RPMs
with debug symbols and see if I can track it down. I'd really like to
get this working so I can redo the interactive imagery modules.
--
Brad Douglas <rez touchofmadness com> KB8UYR/6
Address: 37.493,-121.924 / WGS84 National Map Corps #TNMC-3785
Glynn Clements
2007-11-14 22:56:50 UTC
Permalink
Post by Brad Douglas
Post by Glynn Clements
Post by Brad Douglas
Post by Daniel Calvelo
Which widget was it? If it's part of the contrib widgets in wx2.8,
that's manageable.
GRASS 6.3.cvs (utm10):/usr/src/grass63 > wxgrass
File "/opt/gis/grass-6.3.cvs/etc/wx/wxgui.py", line 16, in ?
import wx.richtext
File
"/usr/lib64/python2.4/site-packages/wx-2.8-gtk2-unicode/wx/richtext.py",
line 4, in ?
import _richtext
ImportError: /usr/lib64/python2.4/site-packages/wx-2.8-gtk2-unicode/wx/_richtext.so: undefined symbol: wxEVT_COMMAND_RICHTEXT_CHARACTER
This is what led me to believe it was a python2.5 symbol, but I'm
relatively inexperienced with wxpython. There are also no unresolved
libraries linked to _richtext.so.
It should be in libwx_gtk2ud_richtext-2.8.so
Post by Brad Douglas
Post by Daniel Calvelo
Did you try setting PYTHONPATH with a hand-compiled version of wxpython?
I shouldn't have to, but I did it anyway to make sure. No dice. :(
Are the wx 2.8 libraries visible (ld.so.conf or $LD_LIBRARY_PATH)?
The wx libraries reside in /usr/lib64, so I would be rather surprised if
they weren't in the LD path. :-)
Have you run ldconfig since putting them there? Does running ldd on
_richtext.so show their locations?
--
Glynn Clements <***@gclements.plus.com>
Daniel Calvelo
2007-11-14 22:56:50 UTC
Permalink
On 5/18/07, Brad Douglas <***@touchofmadness.com> wrote:
[...]
Post by Brad Douglas
GRASS 6.3.cvs (utm10):/usr/src/grass63 > wxgrass
File "/opt/gis/grass-6.3.cvs/etc/wx/wxgui.py", line 16, in ?
import wx.richtext
File
"/usr/lib64/python2.4/site-packages/wx-2.8-gtk2-unicode/wx/richtext.py",
line 4, in ?
import _richtext
ImportError: /usr/lib64/python2.4/site-packages/wx-2.8-gtk2-unicode/wx/_richtext.so: undefined symbol: wxEVT_COMMAND_RICHTEXT_CHARACTER
This is what led me to believe it was a python2.5 symbol, but I'm
relatively inexperienced with wxpython. There are also no unresolved
libraries linked to _richtext.so.
It is not python-related. wxEVT_COMMAND_RICHTEXT_CHARACTER is a
wxWidgets symbol (i.e. the C++ part of wxPython); _richtext.so is the
C++-Python glue for the wx.richtext widgets. What is not found is the
C++ library corresponding to that.

Check which libraries are linked into _richtext.so using ldd, and
whether stg like libwx2.8_raster is there and is defined.

Also, were all the libraries compiled in the same 64 or 32-bit mode?

Since you have everything in $PYTHON/site-packages, python should have
no problem finding its libraries. The systems linker might.

Daniel
--
-- Daniel Calvelo Aros
Michael Barton
2007-11-14 22:56:50 UTC
Permalink
We initially had a problem with the wxpython installation on FC6. Once we
manually moved the built binaries from the source folder to the
python/lib/site-packages (need to see where this is on your system), it was
fine. You can also alter your PYTHONPATH variable to find it in other
locations, but moving it to the "normal" location was the most successful.
Don't for get to move ALL the binary stuff that is built.

Wish I could be more specific about the files, but it was pretty obvious
when we looked at them. On my mac (here at home) it includes directories
wx-2.8-mac-ansi and wxaddons, along with files wx.pth,
wxaddons-2.8.1.1-py2.5.eg-info, wxPython_common-2.8.1.1-py2.5.egg-info, and
wxversion.py. I'm pretty sure that we used Python 2.4 on FC6.

Whichever Python version you use, you need to make sure you have the
wxPython version to match.

Michael
Post by Brad Douglas
I had similar problems after installing the RPMs I built, but I got a
bit further until it complained about a specific 'widget'. I traced it
back to a requirement on python-2.5+ (that's how it appeared). Please
correct me if I'm wrong because I'd really like to get this working with
GRASS[1].
[1] I can't upgrade python without upgrading to an unstable development
version of the OS due to massive dependencies. Not something I want to
do and still be able to build GRASS RPMs reliably.
Post by Yann
Hi,
System: Debian unstable (from Kanotix originally)
- installed wxgtk2.6, had a problem, wxgrass could not find wx.combo.
- compiled from source wxpython2.8.0
(./configure --prefix=/usr --enable-combobox --with-gtk --with-gnomeprint
--with-opengl --enable-geometry --enable-display ;
make ; make install)
- wxgrass does not find wx
-----------------------------------------------------------------
GRASS 6.3.cvs (biwago):~ > wxgrass
File "/usr/local/grass-6.3.cvs/etc/wx/wxgui.py", line 11, in ?
import wx
ImportError: No module named wx
----------------------------------------------------------------
Anybody can tell me the missing link to make the new wx visible to python?
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton
Michael Barton
2007-11-14 22:56:50 UTC
Permalink
I seem to remember that Jachym reported some problem with the richtext
control for Windows and that we were not going to use it. Where is it being
used?

Michael
Post by Glynn Clements
Post by Brad Douglas
Post by Glynn Clements
Post by Brad Douglas
Post by Daniel Calvelo
Which widget was it? If it's part of the contrib widgets in wx2.8,
that's manageable.
GRASS 6.3.cvs (utm10):/usr/src/grass63 > wxgrass
File "/opt/gis/grass-6.3.cvs/etc/wx/wxgui.py", line 16, in ?
import wx.richtext
File
"/usr/lib64/python2.4/site-packages/wx-2.8-gtk2-unicode/wx/richtext.py",
line 4, in ?
import _richtext
undefined symbol: wxEVT_COMMAND_RICHTEXT_CHARACTER
This is what led me to believe it was a python2.5 symbol, but I'm
relatively inexperienced with wxpython. There are also no unresolved
libraries linked to _richtext.so.
It should be in libwx_gtk2ud_richtext-2.8.so
Post by Brad Douglas
Post by Daniel Calvelo
Did you try setting PYTHONPATH with a hand-compiled version of wxpython?
I shouldn't have to, but I did it anyway to make sure. No dice. :(
Are the wx 2.8 libraries visible (ld.so.conf or $LD_LIBRARY_PATH)?
The wx libraries reside in /usr/lib64, so I would be rather surprised if
they weren't in the LD path. :-)
Have you run ldconfig since putting them there? Does running ldd on
_richtext.so show their locations?
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton
Michael Barton
2007-11-14 22:56:50 UTC
Permalink
It is not used, so I took it out. Committed just a few minutes ago.

Michael
wxgui.py imports wx.richtext (see the error messages below).
Post by Michael Barton
I seem to remember that Jachym reported some problem with the richtext
control for Windows and that we were not going to use it. Where is it being
used?
Michael
Post by Glynn Clements
Post by Brad Douglas
Post by Daniel Calvelo
Post by Glynn Clements
Post by Brad Douglas
Post by Daniel Calvelo
Which widget was it? If it's part of the contrib widgets in
wx2.8,
Post by Michael Barton
Post by Glynn Clements
Post by Brad Douglas
Post by Daniel Calvelo
Post by Glynn Clements
Post by Brad Douglas
Post by Daniel Calvelo
that's manageable.
GRASS 6.3.cvs (utm10):/usr/src/grass63 > wxgrass
File "/opt/gis/grass-6.3.cvs/etc/wx/wxgui.py", line 16, in ?
import wx.richtext
File
"/usr/lib64/python2.4/site-packages/wx-2.8-gtk2-unicode/wx/richtext.py",
Post by Daniel Calvelo
Post by Glynn Clements
Post by Brad Douglas
line 4, in ?
import _richtext
undefined symbol: wxEVT_COMMAND_RICHTEXT_CHARACTER
This is what led me to believe it was a python2.5 symbol, but I'm
relatively inexperienced with wxpython. There are also no
unresolved
Post by Daniel Calvelo
Post by Glynn Clements
Post by Brad Douglas
libraries linked to _richtext.so.
It should be in libwx_gtk2ud_richtext-2.8.so
Post by Brad Douglas
Post by Daniel Calvelo
Did you try setting PYTHONPATH with a hand-compiled version of
wxpython?
Post by Glynn Clements
Post by Brad Douglas
I shouldn't have to, but I did it anyway to make sure. No dice.
:(
Post by Michael Barton
Post by Glynn Clements
Post by Brad Douglas
Post by Daniel Calvelo
Post by Glynn Clements
Are the wx 2.8 libraries visible (ld.so.conf or $LD_LIBRARY_PATH)?
The wx libraries reside in /usr/lib64, so I would be rather surprised
if
Post by Michael Barton
Post by Glynn Clements
Post by Brad Douglas
Post by Daniel Calvelo
they weren't in the LD path. :-)
Have you run ldconfig since putting them there? Does running ldd on
_richtext.so show their locations?
--
Brad Douglas <rez touchofmadness com> KB8UYR/6
Address: 37.493,-121.924 / WGS84 National Map Corps #TNMC-3785
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-gui/attachments/20070519/3e55f1f2/attachment.html
Loading...