Re: Neuronvisio in ubuntu 10.04

70 views
Skip to first unread message

Michele Mattioni

unread,
Sep 27, 2011, 2:53:46 PM9/27/11
to Nacer Bouchekhima, neuronvisio
Hi Nacer,

What's your Matplotlib backend?
in the ~/.matplotlib/matplotlibrc file, there should be the choice
for the backend. (Mine is around 31)

backend : Qt4Agg

Below there is the extract from mine.

# the default backend; one of GTK GTKAgg GTKCairo CocoaAgg FltkAgg
27 # MacOSX QtAgg Qt4Agg TkAgg WX WXAgg Agg Cairo GDK PS PDF SVG Template
28 # You can also deploy your own backend outside of matplotlib by
29 # referring to the module name (which must be in the PYTHONPATH) as
30 # 'module://my_backend'
31 backend : Qt4Agg
32 #backend : GTKCairo
33 #backend : WXAgg


P.S.: I included the neuronvisio ML, 'cause it could be useful for
others as well.

HIH,
Michele


On Tue, Sep 27, 2011 at 5:43 PM, Nacer Bouchekhima
<a.bouc...@warwick.ac.uk> wrote:
> Hi Michelle,
> I am trying to install neuronvisio in Ubuntu 10.04 which comes with python
> 2.6 as its default version.
> I followed the steps
> in http://mattions.github.com/neuronvisio/install.html but when I launch
> nrnvisio from the command line or using python –q4thread I get this error:
> =======================
> You must use the Qt4 backend to be able to use  Neuronvisio.
> Check your backend in ~/.matplotlib/matplotlibrc and set it to Qt4Agg
> =======================
> Any hel p would very much appreciated
> Nacer
> --------
> Centre for Complexity Science,
> Zeeman Building,
> University of Warwick,
> Coventry
> CV4 7AL,
> UK
> Tel: 024761 50862
>

Mike Vella

unread,
Sep 28, 2011, 5:40:09 AM9/28/11
to neuro...@googlegroups.com, Nacer Bouchekhima
I have the exact same error on one of my 10.04 machines and not the
other...very strange.

Michele Mattioni

unread,
Sep 28, 2011, 5:43:04 AM9/28/11
to neuro...@googlegroups.com, Nacer Bouchekhima
I didn't reply to the whole group!

Here it is:

Copy the file from /etc/matplotlibrc
to ~/.matplotlib/matplotlibrc

cp /etc/matplotlibrc ~/.matplotlib/matplotlibrc

and then change the backend to Qt (by default Ubuntu is shipped with
gtk backend for matplotlib ) ;)

backend : Qt4Agg

HIH,
Michele.

Michele Mattioni

unread,
Sep 28, 2011, 6:15:43 AM9/28/11
to Nacer Bouchekhima, neuro...@googlegroups.com
What do you run before that?
Can you send a test code which I can check?

Cheers,
Michele.

On Wed, Sep 28, 2011 at 11:14 AM, Nacer Bouchekhima
<a.bouc...@warwick.ac.uk> wrote:
> Sorry to bother you again I am getting the following error:
>
>
> ======================================
> In [5]:
> ---------------------------------------------------------------------------
> AttributeError                            Traceback (most recent call last)
>
> /usr/local/lib/python2.6/dist-packages/neuronvisio/controls.pyc in
> launch_visio(self)
>    149         self.ui.statusbar.showMessage(msg, 3500)
>    150         if not hasattr(self, 'visio'):
> --> 151             self.visio = Visio(self.ui.sec_info_label,
> self.manager)
>    152             self.visio.draw_model()
>    153
>
> /usr/local/lib/python2.6/dist-packages/neuronvisio/visio.pyc in
> __init__(self, sec_info_label, manager)
>    131         figure = self.mayavi.visualization.scene.mlab.gcf()
>    132         self.outline = None
> --> 133         self.picker = figure.on_mouse_pick(self.picker_callback,
> type='cell')
>    134
>    135         # ScalarBar and time_point
>
>
> AttributeError: 'Scene' object has no attribute 'on_mouse_pick'
>
> ======================================
>
>
> Whenever I load my ".hoc" file neuronvisio crashes issuing the above
> message?
>
> Is it to do with mayavi?
>
>
> Nacer
>
> Dr. Nacer Bouchekhima

Michele Mattioni

unread,
Sep 28, 2011, 6:39:35 AM9/28/11
to Nacer Bouchekhima, neuronvisio
Hi Nacer,

the problem you didn't compile the mod file, then NEURON can't
instantiate the model, and then Neuronvisio fails 'cause there is no
model to plot.

in the output there should be something like:

In [2]: h.load_file('leak.hoc')
NEURON: syntax error
in leak.hoc near line 5
insert leak
^
xopen("leak.hoc")
execute1("{xopen("leak.hoc")}")
load_file("leak.hoc")


This means NEURON is looking for the compiled leak.mod, it doesn't
find it and then it fails.
To fix this, you always need to run

nrnivmodl

to compile your mod file first. (On Linux, on windows the name of the
executable is different)

Then everything should work as expected. (works here.)

HIH,
Michele

2011/9/28 Nacer Bouchekhima <a.bouc...@warwick.ac.uk>:
> Thanks for the reply.
> These are the steps which lead to the crash:
>
> 1) > ipython -q4thread
> 2) In [1]: from neuronvisio.controls import Controls3) In [2]: from neuron
> import h
> 4) In [3]: controls = Controls()
>        At this stage I Neuronvisio GUI
> 5) In [4]: h.load_file('leak.hoc')      Out[4]: 1.0
> 6) Now when I press on Plot3d button on the GUI I get
> The following
> =================================================================>


> In [5]:
> ---------------------------------------------------------------------------
> AttributeError                            Traceback (most recent call last)
>
> /usr/local/lib/python2.6/dist-packages/neuronvisio/controls.pyc in
> launch_visio(self)
>    149         self.ui.statusbar.showMessage(msg, 3500)
>    150         if not hasattr(self, 'visio'):
> --> 151             self.visio = Visio(self.ui.sec_info_label,
> self.manager)
>    152             self.visio.draw_model()
>    153
>
> /usr/local/lib/python2.6/dist-packages/neuronvisio/visio.pyc in
> __init__(self, sec_info_label, manager)
>    131         figure = self.mayavi.visualization.scene.mlab.gcf()
>    132         self.outline = None
> --> 133         self.picker = figure.on_mouse_pick(self.picker_callback,
> type='cell')
>    134
>    135         # ScalarBar and time_point
>
>
> AttributeError: 'Scene' object has no attribute 'on_mouse_pick'

> =================================================================<
>
>
>
>
> I am also attaching the leak.hoc and leak.mod files
>
> Thanks for your help

Michele Mattioni

unread,
Sep 28, 2011, 6:43:35 AM9/28/11
to Nacer Bouchekhima, neuronvisio
P.S.: You have to compile it once, not everytime you launch the model!

erikolivares

unread,
Nov 17, 2011, 1:02:55 PM11/17/11
to neuronvisio
HI everybody
Iḿ trying to install neuronvisio in Ubuntu 10.04.
I change the backend in matplotlibrc file. However i still have this
error:

loading membrane mechanisms from x86_64/.libs/libnrnmech.so
Additional mechanisms from files
cadecay.mod dr.mod leak.mod ou.mod sdsr.mod trpm8.mod
Warning: Unable to import the qt4 backend for pyface due to traceback:
Traceback (most recent call last):
File "/usr/lib/python2.6/dist-packages/enthought/pyface/
toolkit.py", line 40, in _init_toolkit
__import__(be + 'init')
ImportError: No module named qt4.init

Info: Unable to import any backend (qt4) for pyface; using the 'null'
toolkit instead.

/usr/lib/python2.6/dist-packages/enthought/traits/ui/toolkit.py:128:
UserWarning: Unable to import the 'qt4' backend for traits UI; using
the 'null' toolkit instead.
"using the 'null' toolkit instead." % toolkit_name )

Thanks in advance

Erick

Michele Mattioni

unread,
Nov 17, 2011, 3:14:47 PM11/17/11
to neuro...@googlegroups.com
Hi Erik,

do you have pyqt installed?

erikolivares

unread,
Nov 17, 2011, 4:01:56 PM11/17/11
to neuronvisio
No error whit: >>>import PyQt4

but whit:
>>> from neuronvisio.controls import Controls
NEURON -- Release 7.1 (359:7f113b76a94b) 2009-10-26
Duke, Yale, and the BlueBrain Project -- Copyright 1984-2008
See http://www.neuron.yale.edu/credits.html

Warning: Unable to import the qt4 backend for pyface due to traceback:
Traceback (most recent call last):
File "/usr/lib/python2.6/dist-packages/enthought/pyface/
toolkit.py", line 40, in _init_toolkit
__import__(be + 'init')
ImportError: No module named qt4.init

Info: Unable to import any backend (qt4) for pyface; using the 'null'
toolkit instead.

/usr/lib/python2.6/dist-packages/enthought/traits/ui/toolkit.py:128:
UserWarning: Unable to import the 'qt4' backend for traits UI; using
the 'null' toolkit instead.
"using the 'null' toolkit instead." % toolkit_name )
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.6/dist-packages/neuronvisio/
controls.py", line 65, in <module>
from visio import Visio
File "/usr/local/lib/python2.6/dist-packages/neuronvisio/visio.py",
line 49, in <module>
class Visualization(HasTraits):
File "/usr/local/lib/python2.6/dist-packages/neuronvisio/visio.py",
line 63, in Visualization
view = View(Item('scene',
editor=SceneEditor(scene_class=MayaviScene),
File "/usr/lib/python2.6/dist-packages/enthought/tvtk/pyface/
toolkit.py", line 88, in __init__
raise NotImplementedError("the %s pyface backend doesn't implement
%s" % (be, oname))
NotImplementedError: the enthought.tvtk.pyface.ui.qt4. pyface backend
doesn't implement SceneEditor



On Nov 17, 5:14 pm, Michele Mattioni <matti...@gmail.com> wrote:
> Hi Erik,
>
> do you have pyqt installed?
>

erik olivares

unread,
Nov 17, 2011, 4:14:13 PM11/17/11
to neuronvisio
Zorry MIchele, I'm new on google groups. I send you replies on the list or by mail? anyway...
--
Erick Olivares
Doctorado en Ciencias, mención Neurociencias.
Universidad de Valparaíso

Michele Mattioni

unread,
Nov 17, 2011, 4:16:39 PM11/17/11
to neuro...@googlegroups.com
Do you have the TraitsBackendQt installed?
It's a part of TraitsGUI

No problem, keep sending the mail to the list. It's fine :)

erikolivares

unread,
Nov 17, 2011, 4:37:42 PM11/17/11
to neuronvisio
That was!!
sudo apt-get install python-traitsbackendqt

NOw itś working. Thanks you ,



On Nov 17, 6:01 pm, erikolivares <erickolivar...@gmail.com> wrote:
> No error whit:  >>>import PyQt4
>
> but whit:>>> from neuronvisio.controls import Controls
>
> NEURON -- Release 7.1 (359:7f113b76a94b) 2009-10-26
> Duke, Yale, and the BlueBrain Project -- Copyright 1984-2008
> Seehttp://www.neuron.yale.edu/credits.html
Reply all
Reply to author
Forward
0 new messages