Missing python package

I just ran a macports upgrade of py-gtk2 to version
2.10.4, and now GRC won’t run. Gives the error message:

Missing critical module: “pygtk”
Exiting!

GRC and GnuRadio were running fine before I did the
upgrade. System stats are:

MacBook Pro w/Intel core 2 Duo processor
OSX 10.4.11
GnuRadio 3.1.1
GRC 0.69

Michael, Josh, any ideas?

@(^.^)@ Ed

I just tried using py25-gtk2 (2.12.0; my personal install with a
Python 2.5 framework, which is also a personal install), and it works
just fine. I’m moving back to Python 2.4 (not my personal install,
just MacPorts) to test that out, and will report back when I know
more … I didn’t have py-gtk2 installed, and that has a whole bunch
of dependencies that need to be installed first, etc…

On a side note related to MacPorts and Python, some of the py-
modules aren’t installed correctly any longer; some never were (who’s
doing QA here!). py-gtk2 might be one of them. As e.g.: wx-python
2.8 doesn’t create the correct directory structure to do “import
wx” … links are needed to do this correctly (and aren’t part of the
standard Portfile; corrections have been submitted for this
particular bug).

NOTE: My previous comment about WX not working properly applied to
Python 2.5, not Python 2.4. Apparently the latter searches
subdirectories while the former does not. Thus the need to link in
subdirector(ies) into the actual PYTHONPATH.

After getting the necessary background stuff installed, GRC works OK
using a standard MacPorts python 2.4 install. I am running: Intel
iMac 20", OSX 10.4.11, latest GNU Radio SVN trunk, latest GRC SVN trunk.

Things to check:

  • ‘port installed’ returns include (for GRC; dependencies will also
    be installed; make sure these are ‘active’ and if not then ‘activate’
    them):

    py-gtk2 @2.10.4_0 (active)
    py-xml @0.8.4_0 (active)

  • ‘cd /opt/local_2.4/lib/python2.4/site-packages ; ls’ contains (at
    least):

_xmlplus/
cairo/
gtk-2.0/
numpy/
pygtk.pth
pygtk.py
pygtk.pyc
pygtk.pyo
wx-2.8-mac-unicode/
wx.pth
wxaddons/
wxversion.py
wxversion.pyc

  • ‘printenv’ contains the following (or more, but at least these):

PATH=/opt/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/
X11R6/bin
PYTHONPATH=/opt/local/lib/python2.4/site-packages:/usr/local/lib/
python2.4/site-packages

Michael,

What I found was that, for some unknown reason, some of the
packages that got recompiled as a result of doing
“sudo port upgrade py-gtk2” ended up in
/opt/local/lib/python2.3/site-packages/ instead of in
/opt/local/lib/python2.4/site-packages/! This included
cairo, gtk2.0, and pygtk.

In addition, executing “pythonw -V” now invoked pythonw2.3
instead of pythonw2.4. On the other hand, “python -V” invoked
python2.4 as it should.

For the time being, I got things to work by copying the packages
to python2.4/site-packages, and linking /usr/bin/pythonw to
/opt/local/Library/Frameworks/Python.framework/Versions/2.4/bin/pythonw2.4

Things are working again now. Unfortunately, the problem I was trying
to fix with the upgrade is still there. About 20% of the time,
a flowgraph being run under GRC does not exit cleanly, and crashes
GRC with a GTK error:

/Users/edwardc/Work/gnu_radio/grc_0.69/src/ActionHandler.py:67:
GtkWarning: Invalid text buffer iterator: either the iterator is
uninitialized, or the characters/pixbufs/widgets in the buffer have been
modified since the iterator was created.
You must use marks, character numbers, or line numbers to preserve a
position across buffer modifications.
You can apply tags and insert marks without invalidating your iterators,
but any mutation that affects ‘indexable’ buffer contents (contents that
can be referred to by character offset)
will invalidate all outstanding iterators
gtk.main()
Bus error

@(^.^)@ Ed

Ed - Sorry to hear about your troubles with MacPorts; glad to hear
that you got them working, one way or the other.

On Dec 20, 2007, at 1:57 PM, Ed Criscuolo wrote:

For the time being, I got things to work by copying the packages
to python2.4/site-packages, and linking /usr/bin/pythonw to
/opt/local/Library/Frameworks/Python.framework/Versions/2.4/bin/
pythonw2.4

I think the issue was a change to python24 on August 21 (2007):
removed the non-versioned binaries called “python” and “pythonw”.
IIRC, I went in and make symlinks to them in /opt/local/bin, which
did the trick. The reason why some py-XXX modules were being
installed in the 2.3 directory and some in 2.4 is that some modules
invoke (incorrectly) “python setup.py” - which would result in a 2.3
directory since “python” would be the Apple-provided one -, while
others (correctly) “/opt/local/bin/pythonX.Y setup.py” - which would
result in the 2.4 (or whatever version of Python is installed by
MacPorts in that directory). I know that the MacPorts folks are
transitioning to the explicit calling method, but I’m sure that there
are ports out there that do not yet use it.

The -best- solution would be to remove those site-packages that you
copied from 2.3 to 2.4, then, with the “python -V” returning “2.4”
correctly, have MacPorts uninstall those packages, then reinstall
them. They should appear in the 2.4 site-packages area.

a position across buffer modifications.
You can apply tags and insert marks without invalidating your
iterators,
but any mutation that affects ‘indexable’ buffer contents (contents
that can be referred to by character offset)
will invalidate all outstanding iterators
gtk.main()
Bus error

THis might be caused by the copying of 2.3 site-packages to 2.4, but
who knows. Try reinstalling those packages correctly, then re-run
GRC to see if it works better. If not, then it’s best that Josh look
into this. - MLD

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs