Opened 11 years ago

Closed 11 years ago

#37158 closed defect (worksforme)

Finally Have gnuradio Installed; Runtime Error on Startup

Reported by: mcquiggi (Kevin McQuiggin) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: Cc: michaelld (Michael Dickens)
Port: gnuradio

Description

Hi All:

Thanks to michaeld et al for the assistance so far in getting gnuradio to build on my MB Air.

I finally got the package to build, however, now I am seeing a runtime error when starting gnuradio-companion:

Kevins-MacBook-Air:~ mcquiggi$ gnuradio-companion
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gtk-2.0/gtk/__init__.py:57: GtkWarning: could not open display
  warnings.warn(str(e), _gtk.Warning)
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gnuradio/grc/gui/Actions.py:30: GtkWarning: GdkKeymap *gdk_keymap_get_for_display(GdkDisplay *): assertion `GDK_IS_DISPLAY (display)' failed
  _keymap = gtk.gdk.keymap_get_default()
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gnuradio/grc/gui/Colors.py:24: GtkWarning: GdkColormap *gdk_screen_get_system_colormap(GdkScreen *): assertion `GDK_IS_SCREEN (screen)' failed
  _COLORMAP = gtk.gdk.colormap_get_system() #create all of the colors
Traceback (most recent call last):
  File "/opt/local/bin/gnuradio-companion", line 58, in <module>
    from gnuradio.grc.python.Platform import Platform
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gnuradio/grc/python/Platform.py", line 24, in <module>
    from FlowGraph import FlowGraph as _FlowGraph
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gnuradio/grc/python/FlowGraph.py", line 22, in <module>
    from .. gui.FlowGraph import FlowGraph as _GUIFlowGraph
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gnuradio/grc/gui/FlowGraph.py", line 22, in <module>
    import Colors
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gnuradio/grc/gui/Colors.py", line 27, in <module>
    HIGHLIGHT_COLOR = get_color('#00FFFF')
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gnuradio/grc/gui/Colors.py", line 25, in get_color
    def get_color(color_code): return _COLORMAP.alloc_color(color_code, True, True)
AttributeError: 'NoneType' object has no attribute 'alloc_color'

I also tried starting the package with higher privileges, i.e. "sudo gnuradio-companion". No difference.

This may not be a port issue, but I thought I should post it in case it is.

Kevin

Change History (21)

comment:1 Changed 11 years ago by michaelld (Michael Dickens)

What does

port installed | grep gtk

return?

comment:2 Changed 11 years ago by mcquiggi (Kevin McQuiggin)

Hi:

It returns:

Kevins-MacBook-Air:~ mcquiggi$ sudo port installed | grep gtk
Password:
  gtk-doc @1.18_0+python27 (active)
  gtk2 @2.24.13_0+x11 (active)
  py26-gtk @2.22.0_3 (active)
  py26-wxpython @2.8.10.1_0+gtk (active)
  py27-gtk @2.22.0_3+x11 (active)
  wxWidgets-python @2.8.12.0_0+gtk (active)
Kevins-MacBook-Air:~ mcquiggi$ 

comment:3 Changed 11 years ago by michaelld (Michael Dickens)

And, what does

port installed | grep wx

return?

comment:4 Changed 11 years ago by mcquiggi (Kevin McQuiggin)

Kevins-MacBook-Air:~ mcquiggi$ sudo port installed | grep wx
Password:
  gnuradio @3.6.2_0+docs+full+grc+jack+orc+portaudio+python27+qtgui+sdl+swig+uhd+wavelet+wxgui (active)
  py26-wxpython @2.8.10.1_0+gtk (active)
  py27-wxpython-devel @2.9.4.0_0 (active)
  wxWidgets-devel @2.9.4_2+sdl (active)
  wxWidgets-python @2.8.12.0_0+gtk (active)
Kevins-MacBook-Air:~ mcquiggi$

comment:5 Changed 11 years ago by michaelld (Michael Dickens)

What does

which python

return?

comment:6 Changed 11 years ago by mcquiggi (Kevin McQuiggin)

It returns:

  wxWidgets-python @2.8.12.0_0+gtk (active)
Kevins-MacBook-Air:~ mcquiggi$ which python
/opt/local/bin/python
Kevins-MacBook-Air:~ mcquiggi$ 

Thanks for the help. Man, what a tough port to get installed!

comment:7 Changed 11 years ago by michaelld (Michael Dickens)

And what does

python --version

return?

comment:8 Changed 11 years ago by michaelld (Michael Dickens)

If the Python version returned is 2.7.3, then go ahead and also do

python -c "import gtk"

and see what it returns.

comment:9 Changed 11 years ago by mcquiggi (Kevin McQuiggin)

The results:

Kevins-MacBook-Air:~ mcquiggi$ python --version
Python 2.7.3
Kevins-MacBook-Air:~ mcquiggi$ python -c "import gtk"
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gtk-2.0/gtk/__init__.py:57: GtkWarning: could not open display
  warnings.warn(str(e), _gtk.Warning)
Kevins-MacBook-Air:~ mcquiggi$ 

comment:10 Changed 11 years ago by michaelld (Michael Dickens)

I have pretty much the identical setup to yours, and I don't see that warning. What app are you using to get the shell: Terminal? X11? XQuartz?

Do you require the py26* ports? If not, I'd recommend removing them. Also wondering if you need "wxWidgets-python"? Seems (to be) as though wxWidgets will be provided by "wxWidgets-devel" if it is installed, and it is 64-bit which is what you really want (wxWidgets < 2.9 are 32-bit, IIRC).

comment:11 Changed 11 years ago by mcquiggi (Kevin McQuiggin)

Hi:

I am using plain old "Terminal" to get the shell.

I will remove the py26 ports using "port uninstall"; remove wxWidgets-python; and then get back to you with the results.

Kevin

comment:12 Changed 11 years ago by michaelld (Michael Dickens)

OK; when I use the Terminal.app, I still don't get the GTK warning. GRC does work, though it uses X11.app instead of producing an actual OSX .app.

comment:13 Changed 11 years ago by mcquiggi (Kevin McQuiggin)

Could not remove most of the py26- ports due to dependencies. Removed wxWidgets-python and am doing a port install gnuradio to try to set everything straight.

Will advise.

comment:14 Changed 11 years ago by michaelld (Michael Dickens)

OK; in the mean time, what does

env

return?

comment:15 Changed 11 years ago by mcquiggi (Kevin McQuiggin)

See below:

evins-MacBook-Air:~ mcquiggi$ env
TERM_PROGRAM=Apple_Terminal
TERM=xterm-256color
SHELL=/bin/bash
TMPDIR=/var/folders/sc/lj0qmghx5mdbv5h8689mhfv80000gn/T/
Apple_PubSub_Socket_Render=/tmp/launch-Z9jOfQ/Render
TERM_PROGRAM_VERSION=309
TERM_SESSION_ID=370789C3-44C2-4172-9B5B-BF7D5DDB5B9E
USER=mcquiggi
COMMAND_MODE=unix2003
SSH_AUTH_SOCK=/tmp/launch-NywXBt/Listeners
__CF_USER_TEXT_ENCODING=0x1F5:0:0
Apple_Ubiquity_Message=/tmp/launch-ul8V8p/Apple_Ubiquity_Message
PATH=/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
PWD=/Users/mcquiggi
LANG=en_CA.UTF-8
SHLVL=1
HOME=/Users/mcquiggi
LOGNAME=mcquiggi
_=/usr/bin/env
Kevins-MacBook-Air:~ mcquiggi$ 

comment:16 Changed 11 years ago by michaelld (Michael Dickens)

Those environment variables look good. Do you have software installed elsewhere, e.g., by fink or homebrew?

comment:17 Changed 11 years ago by michaelld (Michael Dickens)

Another suggestion: Download XQuartz, install it, and then try running GRC from that terminal. Maybe GTK / GDK requires an actual DISPLAY (which in my X11.app is by default set to ":0" meaning that local X11 display).

comment:18 Changed 11 years ago by mcquiggi (Kevin McQuiggin)

No other software like that installed. Rebuilt gnuradio +full etc and still no go. The same message.

How about uninstalling and cleaning -everything- and starting again? There are no other macports that I would not miss, and could not reinstall. A clean slate, so to speak. How would I do this?

I'd suggest completely deleting macports from my machine, I will then reinstall. Is this doable easily?

I'd like to try this before going for the xquartz etc. as it seems it should not be necessary.

comment:19 Changed 11 years ago by mcquiggi (Kevin McQuiggin)

I will try x Quartz, why not? I'll let you know if that works. D/L in progress.

comment:20 Changed 11 years ago by mcquiggi (Kevin McQuiggin)

Hey, it is working with XQuartz. Must have been the display issue.

Although it seems a workaround and I'd rather not have to have XQuartz, good enough for now.

I'd still like to delete everything and try a fresh install. Any easy way to do this? This might be helpful for future users with the same issues. If we can figure out why it didn't run without XQuartz that is!

Thanks for the help,

Kevin

comment:21 Changed 11 years ago by michaelld (Michael Dickens)

Resolution: worksforme
Status: newclosed

Yay! I don't think you need to fully reinstall; it seems like that's all working now, no matter your feelings towards XQuartz. If you really want to reinstall, follow the migration page's instructions.

If you want to experiment, I'd recommend trying out "gtk2 +quartz" and see if maybe that works. It, in theory, uses OSX's native Quartz display instead of X11, and hence should work from the Terminal.app correctly. I don't think I've ever tried it this way; who knows that it might work?

I'm going ahead and closing this ticket, since I think we've resolved the basic issue. Do let me know (here or on the list) if you succeed with gtk2 and quartz.

Note: See TracTickets for help on using tickets.