Still issues with traits.api...

1,827 views
Skip to first unread message

Rudolph Pienaar

unread,
Jan 24, 2012, 3:50:40 PM1/24/12
to cmtk-users
Hi all --

We downloaded the current 1.2 release and have issues with traits.api:

[shaka:x86_64-Linux-chb-fsdev]~$>connectomemapper
Traceback (most recent call last):
File "/chb/arch/python/cmp_1.2.0/scripts/connectomemapper", line 6,
in <module>
from cmp.gui import CMPGUI
File "/chb/arch/python/cmp_1.2.0/cmp/__init__.py", line 13, in
<module>
import stages.converter.dicomconverter as dicomconverter
File "/chb/arch/python/cmp_1.2.0/cmp/stages/converter/
dicomconverter.py", line 14, in <module>
from cmp.util import reorient
File "/chb/arch/python/cmp_1.2.0/cmp/util.py", line 12, in <module>
from enthought.traits.api import HasStrictTraits, Str
ImportError: No module named enthought.traits.api

I am having no luck in finding a quick fix for this. In fact, I build
a brand new 11.10 VM this morning to make sure it's "clean". The
python packages relating to enthought are:

[shaka:x86_64-Linux-chb-fsdev]...n/cmp_1.2.0/cmp$>apt-cache search
enthought
python-apptools - ETS Application Tools
python-chaco - interactive plotting application toolkit
python-enthoughtbase - Core packages for the Enthought Tool Suite
python-envisageplugins - Plugins for the Envisage framework

I have installed all.

Finally, I went and edited the util.py and replaced the line

from enthought.traits.api import HasStrictTraits, Str

with

from traits.api import HasStrictTraits, Str

only to find that connectomemapper now complained about
'configuration.py' and enthought.traits.api.

Do I need to replace *all* the references to "enthought.traits.api"
with "traits.api"??

Best
-=R

Stephan Gerhard

unread,
Jan 26, 2012, 4:48:45 AM1/26/12
to cmtk-...@googlegroups.com
Hi,
I think the newest Ubuntu ship with Enthought packages where they changed the namespaces.
There is a script to convert all the namespaces properly:
But it needs to be tested on the new Ubuntu versions. And then I would suggest
to make a new release.

Stephan

Nicolas Rannou

unread,
Mar 23, 2012, 4:20:54 PM3/23/12
to cmtk-users
Hi all,

What about modifying all the calls to 'enthought.traits.api' with a
try/except interface to support both versions?

# try to import the new traits library
try:
import traits.api as traits
# look for the old traits library if the new one is not found
except ImportError:
import enthought.traits.api as traits

It appears to work fine so far :)

Thanks,
Nicolas

On Jan 26, 5:48 am, Stephan Gerhard <uni.designer...@gmail.com> wrote:
> Hi,
> I think the newest Ubuntu ship with Enthought packages where they changed
> the namespaces.
> There is a script to convert all the namespaces properly:https://github.com/enthought/etsproxy/blob/master/enthought/ets3to4.py
> But it needs to be tested on the new Ubuntu versions. And then I would
> suggest
> to make a new release.
>
> Stephan
>
> On Tue, Jan 24, 2012 at 9:50 PM, Rudolph Pienaar
> <rudolph.pien...@gmail.com>wrote:

Stephan Gerhard

unread,
Mar 23, 2012, 8:51:46 PM3/23/12
to cmtk-...@googlegroups.com
Yes, you could do that to support both version. Just change them and
send a pull request through github :)
Stephan

Ping-Hong Yeh

unread,
Mar 24, 2012, 9:17:14 AM3/24/12
to cmtk-...@googlegroups.com
Hi all,

I've tried what Nicolas suggested on my MAC OS, and it compiled
without errors, but when typing "connectomemapper", the GUI failed.

Traceback (most recent call last):

File "/Library/Frameworks/Python.framework/Versions/2.7/bin/connectomemapper",


line 6, in <module>
from cmp.gui import CMPGUI

File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cmp/gui.py",
line 18, in <module>
from enthought.traits.ui.api import View, Item, HGroup, Handler, \
ImportError: No module named api

Any further suggestion?

Thanks.
Ping


On Fri, Mar 23, 2012 at 4:20 PM, Nicolas Rannou <huko....@gmail.com> wrote:

cmpetty

unread,
Mar 27, 2012, 10:29:38 AM3/27/12
to cmtk-...@googlegroups.com
ping, are you using the entire enouthought suite, or have you installed traits separately?

if not using the entire suite, the import would be: import traitsui.api

Solleo Kim

unread,
Jul 30, 2012, 9:20:23 AM7/30/12
to cmtk-...@googlegroups.com
Hi, I guess I'm also having a similar problem here

in the iPython, 
import cmp
works fine, but I can't run it in gui. 

For the name of the modules, I've fixed enthought.traits.api to traits.api, but 
can't find a proper new version of enthought.traits.ui.api and enthought.traits.ui.table_column
in the cmp/gui.py

I've installed python-traitsgui... oh, wait! I've got it!

only I need to install python-traitsui instead of gui


don't know if it's a unique dependency of my Ubuntu machine, but it works fine anyways :D


2012년 3월 27일 화요일 오후 11시 29분 38초 UTC+9, cmpetty 님의 말:

Fabricio Pereira

unread,
Aug 20, 2012, 3:54:50 PM8/20/12
to cmtk-...@googlegroups.com
Step by step for Ubuntu 12.04.1 LTS (precise) on x86_64 after downloaded Connectome Mapper

1. untar and unzip file (eg Installation Instruction website) 
>> tar xzf LTS5-....tar.gz

2. donwload the Stephan Gerhards' scritp 

3. Apply the script to the folder 'unziped' 
>> python ets3to4.py LTS5-cmp-59392e2

4. Change to the folder unziped and install the Connectome Mapper
>> cd LTS5-cmp-59392e2 ; python setup.py install 

5. Install python-traitsui as Solleo Kim suggested. 
>> sudo apt-get install python-traitsui

6. Set the environment variables (back to the Installation Instruction website) 


Best. 
Fabricio



Januz

unread,
Oct 24, 2012, 9:36:34 AM10/24/12
to cmtk-...@googlegroups.com
Hi,

I tried to install the connectomemapper with these instructions on a neurodebian VirtualBox in a virtual environment (so I installed all packages with pip).

I can import cmp in iPython, but when I try to start the GUI from the command line, I get the following error message:

------------------------------------------------------------------
(Januz-Py-273)neurodebian% connectomemapper

Traceback (most recent call last):
  File "/home/brain/.virtualenvs/Januz-Py-273/bin/connectomemapper", line 14, in <module>
    cmpgui.show()
  File "/home/brain/.virtualenvs/Januz-Py-273/lib/python2.7/site-packages/cmp/gui.py", line 503, in show
    self.edit_traits(kind='livemodal')
  File "/home/brain/.virtualenvs/Januz-Py-273/lib/python2.7/site-packages/traits/has_traits.py", line 2266, in edit_traits
    handler, id, scrollable, args )
  File "/home/brain/.virtualenvs/Januz-Py-273/lib/python2.7/site-packages/traitsui/view.py", line 433, in ui
    ui.ui( parent, kind )
  File "/home/brain/.virtualenvs/Januz-Py-273/lib/python2.7/site-packages/traitsui/ui.py", line 218, in ui
    self.rebuild( self, parent )
  File "/home/brain/.virtualenvs/Januz-Py-273/lib/python2.7/site-packages/traitsui/toolkit.py", line 168, in ui_livemodal
    raise NotImplementedError
NotImplementedError
----------------------------------------

Would be nice if you could help me!

Thanks,

J
Message has been deleted

Pedro Costa del Amo

unread,
Mar 30, 2013, 9:17:23 AM3/30/13
to cmtk-...@googlegroups.com
Hello all,

I've run into the same problem that Januz did a couple months ago. The difference is that I am not using a virtual environment, but SUSE Linux Enterprise Server 11 (x86_64). I can import cmp in ipython as desired, but when I attempt to start connectomemapper from the command line, I get the following error: 



costa@xcat:~/bin/cmp-master/scripts> ~/bin/Python-2.7.3/python connectomemapper Traceback (most recent call last):
  File "connectomemapper", line 14, in <module>
    cmpgui.show()
  File "/home/costa/bin/Python-2.7.3/lib/python2.7/site-packages/cmp/gui.py", line 503, in show
    self.edit_traits(kind='livemodal')
  File "/home/costa/bin/Python-2.7.3/lib/python2.7/site-packages/traits-4.3.0-py2.7-linux-x86_64.egg/traits/has_traits.py", line 2268, in edit_traits
    handler, id, scrollable, args )
  File "/home/costa/bin/Python-2.7.3/lib/python2.7/site-packages/traitsui-4.3.0-py2.7.egg/traitsui/view.py", line 433, in ui
    ui.ui( parent, kind )
  File "/home/costa/bin/Python-2.7.3/lib/python2.7/site-packages/traitsui-4.3.0-py2.7.egg/traitsui/ui.py", line 218, in ui
    self.rebuild( self, parent )
  File "/home/costa/bin/Python-2.7.3/lib/python2.7/site-packages/traitsui-4.3.0-py2.7.egg/traitsui/toolkit.py", line 168, in ui_livemodal
    raise NotImplementedError
NotImplementedError

Any help is more than welcome.


Best,


Pedro

Esha Datta

unread,
Sep 18, 2013, 3:11:51 PM9/18/13
to cmtk-...@googlegroups.com
I am running into the exact same problem.  Did you ever find a fix to this issue?

Traceback (most recent call last):
  File "/netopt/python2.6/bin/connectomemapper", line 14, in <module>
    cmpgui.show()
  File "/netopt/python2.6/lib/python2.6/site-packages/cmp/gui.py", line 509, in show
    self.edit_traits(kind='livemodal')
  File "/netopt/python2.6/lib/python2.6/site-packages/traits-4.2.1-py2.6-linux-x86_64.egg/traits/has_traits.py", line 2266, in edit_traits
    handler, id, scrollable, args )
  File "/netopt/python2.6/lib/python2.6/site-packages/traitsui-4.2.1-py2.6.egg/traitsui/view.py", line 433, in ui
    ui.ui( parent, kind )
  File "/netopt/python2.6/lib/python2.6/site-packages/traitsui-4.2.1-py2.6.egg/traitsui/ui.py", line 218, in ui
    self.rebuild( self, parent )
  File "/netopt/python2.6/lib/python2.6/site-packages/traitsui-4.2.1-py2.6.egg/traitsui/toolkit.py", line 168, in ui_livemodal
    raise NotImplementedError
NotImplementedError

Alessandra Griffa

unread,
Sep 23, 2013, 5:57:33 AM9/23/13
to cmtk-...@googlegroups.com
Did you try to install a more recent version of traits and traitsui for example with easy_install?
This is a problem of compatibility with the Enthought libraries.


--
You received this message because you are subscribed to the Google Groups "cmtk-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cmtk-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Eduardo Garza

unread,
Oct 21, 2013, 5:34:30 PM10/21/13
to cmtk-...@googlegroups.com
Thanks a lot, Fabricio

alessandra griffa

unread,
Sep 25, 2014, 9:18:56 AM9/25/14
to cmtk-...@googlegroups.com
Did you try to follow the previous suggestion by Fabricio Pereira; i.e. installing traitsui (sudo apt-get install python-traitsui)?
This worked out for me during a fresh installation.
Alessandra

Joanna Goc

unread,
Oct 9, 2014, 9:59:07 AM10/9/14
to cmtk-...@googlegroups.com, notes...@googlemail.com
Hi Januz,

So did you manage to install Connectome Mapper on the neurodebian? Because I'm trying to do the same (ie do it on a virtual machine) and it's not working.. But I have to say, I don't quite understand what do yo mean that you installed the packages with pip (I'm new to neurodebian).
Also did you manage to install FreeSurfer on Neurodebian? Because apparently it's a requirement for connectome mapper but I can't seem to be able to do it.. Please help!


Best,

Joanna
Reply all
Reply to author
Forward
0 new messages