from tvb.simulator.lab import * problem

266 views
Skip to first unread message

Hannelore Aerts

unread,
Mar 31, 2015, 5:10:55 AM3/31/15
to tvb-...@googlegroups.com
Dear all,

I would like to explore TVB using the IPython Notebook examples for the console interface of TVB. However, I can't get started because I always get errors when I try to import the tvb.simulator.lab modules.

I work on Ubuntu 14.04, with Python version 2.7, I already cloned the github documentation of TVB and installed it on my desktop. When I open the example notebooks, I get an error message like this:

In [2]:

from tvb.simulator.lab import *

---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-2-99cb9d2ecf2b> in <module>()
----> 1 from tvb.simulator.lab import *

/home/hannelore/anaconda/lib/python2.7/site-packages/tvb-1.3-py2.7-linux-x86_64.egg/tvb/simulator/lab.py in <module>()
 
44 import numpy
 
45
---> 46 from tvb.basic.profile import TvbProfile
 
47 TvbProfile.set_profile(TvbProfile.LIBRARY_PROFILE)
 
48

/home/hannelore/anaconda/lib/python2.7/site-packages/tvb-1.3-py2.7-linux-x86_64.egg/tvb/basic/profile.py in <module>()
 
43 import sys
 
44 import copy
---> 45 from tvb.basic.config.environment import Environment
 
46 from tvb.basic.config.profile_settings import BaseSettingsProfile
 
47

ImportError: No module named config.environment

When I try to import the modules in my desktop terminal version of python I get the same error message, but when I open Python IDLE, I don't get any error messages.

Does anyone have an idea what I should do?

Thank you very much.

Kind regards,
Hannelore



Lia Domide

unread,
Mar 31, 2015, 5:40:12 AM3/31/15
to tvb-...@googlegroups.com
Hi,

Could you please do a:
ls -all /home/hannelore/anaconda/lib/python2.7/site-packages/tvb-1.3-py2.7-linux-x86_64.egg/tvb/basic

Thanks,
Lia





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

Hannelore Aerts

unread,
Mar 31, 2015, 5:50:40 AM3/31/15
to tvb-...@googlegroups.com
Hi Lia,

Thank you for your quick reply. I get this:

hannelore@pp01c054:~$ ls -all /home/hannelore/anaconda/lib/python2.7/site-packages/tvb-1.3-py2.7-linux-x86_64.egg/tvb/basic
total
60
drwxrwxr
-x 4 hannelore hannelore 4096 Mär 31 10:09 .
drwxrwxr
-x 7 hannelore hannelore 4096 Mär 31 10:09 ..
-rw-rw-r-- 1 hannelore hannelore 1434 Mär 31 10:09 __init__.py
-rw-rw-r-- 1 hannelore hannelore  192 Mär 31 10:09 __init__.pyc
drwxrwxr
-x 2 hannelore hannelore 4096 Mär 31 10:09 logger
-rw-rw-r-- 1 hannelore hannelore 6918 Mär 31 10:09 profile.py
-rw-rw-r-- 1 hannelore hannelore 4582 Mär 31 10:09 profile.pyc
-rw-rw-r-- 1 hannelore hannelore 8025 Mär 31 10:09 readers.py
-rw-rw-r-- 1 hannelore hannelore 8279 Mär 31 10:09 readers.pyc
drwxrwxr
-x 2 hannelore hannelore 4096 Mär 31 10:09 traits

Lia Domide

unread,
Mar 31, 2015, 5:56:21 AM3/31/15
to tvb-...@googlegroups.com
Hi,

How did you install TVB in your anaconda environment ?
The deployed code you have seems incomplete.

Look how tvb.basic should be:
https://github.com/the-virtual-brain/tvb-library/tree/trunk/tvb/basic

Regards,
Lia.


Hannelore Aerts

unread,
Mar 31, 2015, 7:17:27 AM3/31/15
to tvb-...@googlegroups.com
Hi,

In order to be sure about how I installed everything, I deleted everything from anaconda and TVB and started all over again:
- I first installed Anaconda (version 2.1.0; /home/anaconda)
- Then I downloaded TVB from the website and extracted it (version 1.3; /home/TVB_Distribution)
- Then I cloned the git repository, and installed the python setup (python setup.py install; /home/tvb-library)

I checked in the folder (/anaconda/lib/.../tvb/basics), and now everything appears to be in there. However, I still get error messages when I try to import the modules, albeit different ones:

In [2]:

from tvb.simulator.lab import *

---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)

<ipython-input-2-99cb9d2ecf2b> in <module>()
----> 1 from tvb.simulator.lab import *

/home/hannelore/anaconda/lib/python2.7/site-packages/tvb-1.3-py2.7-linux-x86_64.egg/tvb/simulator/lab.py in <module>()
 
44 import numpy
 
45
---> 46 from tvb.basic.profile import TvbProfile
 
47 TvbProfile.set_profile(TvbProfile.LIBRARY_PROFILE)
 
48

/home/hannelore/anaconda/lib/python2.7/site-packages/tvb-1.3-py2.7-linux-x86_64.egg/tvb/basic/profile.py in <module>()

 
48
 
49
---> 50 class TvbProfile():
 
51 """
 52 ENUM-like class with current TVB profile and accepted values.

/home/hannelore/anaconda/lib/python2.7/site-packages/tvb-1.3-py2.7-linux-x86_64.egg/tvb/basic/profile.py in TvbProfile()
 72 env = Environment()
 73
---> 74 _old_meta_path = copy.deepcopy(sys.meta_path)
 75
 76

/home/hannelore/anaconda/lib/python2.7/copy.pyc in deepcopy(x, memo, _nil)
 161 copier = _deepcopy_dispatch.get(cls)
 162 if copier:
--> 163 y = copier(x, memo)
 164 else:
 165 try:

/home/hannelore/anaconda/lib/python2.7/copy.pyc in _deepcopy_list(x, memo)
 228 memo[id(x)] = y
 229 for a in x:
--> 230 y.append(deepcopy(a, memo))
 231 return y
 232 d[list] = _deepcopy_list

/home/hannelore/anaconda/lib/python2.7/copy.pyc in deepcopy(x, memo, _nil)
 188 raise Error(
 189 "
un(deep)copyable object of type %s" % cls)
--> 190 y = _reconstruct(x, rv, 1, memo)
 191
 192 memo[d] = y

/home/hannelore/anaconda/lib/python2.7/copy.pyc in _reconstruct(x, info, deep, memo)
 332 if state:
 333 if deep:
--> 334 state = deepcopy(state, memo)
 335 if hasattr(y, '__setstate__'):
 336 y.__setstate__(state)

/home/hannelore/anaconda/lib/python2.7/copy.pyc in deepcopy(x, memo, _nil)
 161 copier = _deepcopy_dispatch.get(cls)
 162 if copier:
--> 163 y = copier(x, memo)
 164 else:
 165 try:

/home/hannelore/anaconda/lib/python2.7/copy.pyc in _deepcopy_dict(x, memo)
 255 memo[id(x)] = y
 256 for key, value in x.iteritems():
--> 257 y[deepcopy(key, memo)] = deepcopy(value, memo)
 258 return y
 259 d[dict] = _deepcopy_dict

/home/hannelore/anaconda/lib/python2.7/copy.pyc in deepcopy(x, memo, _nil)
 161 copier = _deepcopy_dispatch.get(cls)
 162 if copier:
--> 163 y = copier(x, memo)
 164 else:
 165 try:

/home/hannelore/anaconda/lib/python2.7/copy.pyc in _deepcopy_dict(x, memo)
 255 memo[id(x)] = y
 256 for key, value in x.iteritems():
--> 257 y[deepcopy(key, memo)] = deepcopy(value, memo)
 258 return y
 259 d[dict] = _deepcopy_dict

/home/hannelore/anaconda/lib/python2.7/copy.pyc in deepcopy(x, memo, _nil)
 188 raise Error(
 189 "
un(deep)copyable object of type %s" % cls)
--> 190 y = _reconstruct(x, rv, 1, memo)
 191
 192 memo[d] = y

/home/hannelore/anaconda/lib/python2.7/copy.pyc in _reconstruct(x, info, deep, memo)
 332 if state:
 333 if deep:
--> 334 state = deepcopy(state, memo)
 335 if hasattr(y, '__setstate__'):
 336 y.__setstate__(state)

/home/hannelore/anaconda/lib/python2.7/copy.pyc in deepcopy(x, memo, _nil)
 161 copier = _deepcopy_dispatch.get(cls)
 162 if copier:
--> 163 y = copier(x, memo)
 164 else:
 165 try:

/home/hannelore/anaconda/lib/python2.7/copy.pyc in _deepcopy_dict(x, memo)
 255 memo[id(x)] = y
 256 for key, value in x.iteritems():
--> 257 y[deepcopy(key, memo)] = deepcopy(value, memo)
 258 return y
 259 d[dict] = _deepcopy_dict

/home/hannelore/anaconda/lib/python2.7/copy.pyc in deepcopy(x, memo, _nil)
 188 raise Error(
 189 "
un(deep)copyable object of type %s" % cls)
--> 190 y = _reconstruct(x, rv, 1, memo)
 191
 192 memo[d] = y

/home/hannelore/anaconda/lib/python2.7/copy.pyc in _reconstruct(x, info, deep, memo)
 332 if state:
 333 if deep:
--> 334 state = deepcopy(state, memo)
 335 if hasattr(y, '__setstate__'):
 336 y.__setstate__(state)

/home/hannelore/anaconda/lib/python2.7/copy.pyc in deepcopy(x, memo, _nil)
 161 copier = _deepcopy_dispatch.get(cls)
 162 if copier:
--> 163 y = copier(x, memo)
 164 else:
 165 try:

/home/hannelore/anaconda/lib/python2.7/copy.pyc in _deepcopy_dict(x, memo)
 255 memo[id(x)] = y
 256 for key, value in x.iteritems():
--> 257 y[deepcopy(key, memo)] = deepcopy(value, memo)
 258 return y
 259 d[dict] = _deepcopy_dict

/home/hannelore/anaconda/lib/python2.7/copy.pyc in deepcopy(x, memo, _nil)
 188 raise Error(
 189 "
un(deep)copyable object of type %s" % cls)
--> 190 y = _reconstruct(x, rv, 1, memo)
 191
 192 memo[d] = y

/home/hannelore/anaconda/lib/python2.7/copy.pyc in _reconstruct(x, info, deep, memo)
 332 if state:
 333 if deep:
--> 334 state = deepcopy(state, memo)
 335 if hasattr(y, '__setstate__'):
 336 y.__setstate__(state)

/home/hannelore/anaconda/lib/python2.7/copy.pyc in deepcopy(x, memo, _nil)
 161 copier = _deepcopy_dispatch.get(cls)
 162 if copier:
--> 163 y = copier(x, memo)
 164 else:
 165 try:

/home/hannelore/anaconda/lib/python2.7/copy.pyc in _deepcopy_dict(x, memo)
 255 memo[id(x)] = y
 256 for key, value in x.iteritems():
--> 257 y[deepcopy(key, memo)] = deepcopy(value, memo)
 258 return y
 259 d[dict] = _deepcopy_dict

/home/hannelore/anaconda/lib/python2.7/copy.pyc in deepcopy(x, memo, _nil)
 161 copier = _deepcopy_dispatch.get(cls)
 162 if copier:
--> 163 y = copier(x, memo)
 164 else:
 165 try:

/home/hannelore/anaconda/lib/python2.7/copy.pyc in _deepcopy_method(x, memo)
 262
 263 def _deepcopy_method(x, memo): # Copy instance methods
--> 264 return type(x)(x.im_func, deepcopy(x.im_self, memo), x.im_class)
 265 _deepcopy_dispatch[types.MethodType] = _deepcopy_method
 266

/home/hannelore/anaconda/lib/python2.7/copy.pyc in deepcopy(x, memo, _nil)
 188 raise Error(
 189 "
un(deep)copyable object of type %s" % cls)
--> 190 y = _reconstruct(x, rv, 1, memo)
 191
 192 memo[d] = y

/home/hannelore/anaconda/lib/python2.7/copy.pyc in _reconstruct(x, info, deep, memo)
 332 if state:
 333 if deep:
--> 334 state = deepcopy(state, memo)
 335 if hasattr(y, '__setstate__'):
 336 y.__setstate__(state)

/home/hannelore/anaconda/lib/python2.7/copy.pyc in deepcopy(x, memo, _nil)
 161 copier = _deepcopy_dispatch.get(cls)
 162 if copier:
--> 163 y = copier(x, memo)
 164 else:
 165 try:

/home/hannelore/anaconda/lib/python2.7/copy.pyc in _deepcopy_dict(x, memo)
 255 memo[id(x)] = y
 256 for key, value in x.iteritems():
--> 257 y[deepcopy(key, memo)] = deepcopy(value, memo)
 258 return y
 259 d[dict] = _deepcopy_dict

/home/hannelore/anaconda/lib/python2.7/copy.pyc in deepcopy(x, memo, _nil)
 188 raise Error(
 189 "
un(deep)copyable object of type %s" % cls)
--> 190 y = _reconstruct(x, rv, 1, memo)
 191
 192 memo[d] = y

/home/hannelore/anaconda/lib/python2.7/copy.pyc in _reconstruct(x, info, deep, memo)
 341 slotstate = None
 342 if state is not None:
--> 343 y.__dict__.update(state)
 344 if slotstate is not None:
 345 for key, value in slotstate.iteritems():

AttributeError: 'NoneType'
object has no attribute 'update'

Of note, when I open the IPython notebooks from my terminal, I get this output, with a fatal error:

hannelore@pp01c054:~/Dropbox/PhD/IPython$ ipython notebook -pylab
WARNING
: `-pylab` flag has been deprecated.
 
Use `--matplotlib <backend>` and import pylab manually.
2015-03-31 13:15:07.031 [NotebookApp] Using existing profile dir: u'/home/hannelore/.ipython/profile_default'
2015-03-31 13:15:07.032 [NotebookApp] WARNING | Starting all kernels in pylab mode is not recommended,
 
and will be disabled in a future release.
 
Please use the %matplotlib magic to enable matplotlib instead.
 pylab implies many imports
, which can have confusing side effects
 
and harm the reproducibility of your notebooks.
2015-03-31 13:15:07.034 [NotebookApp] Using MathJax from CDN: https://cdn.mathjax.org/mathjax/latest/MathJax.js
2015-03-31 13:15:07.040 [NotebookApp] Serving notebooks from local directory: /home/hannelore/Dropbox/PhD/IPython
2015-03-31 13:15:07.040 [NotebookApp] 0 active kernels
2015-03-31 13:15:07.040 [NotebookApp] The IPython Notebook is running at: http://localhost:8888/
2015-03-31 13:15:07.041 [NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

(process:6969): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed



Thank you,

Hannelore

Lia Domide

unread,
Apr 2, 2015, 5:32:11 AM4/2/15
to tvb-...@googlegroups.com
Hi Hannelore,

Please do an update of your github repo https://github.com/the-virtual-brain/tvb-library
@ maedoc recently added a fix related to the deepcopy issue.
If that still doesn't work for you, simply comment in file tvb/basic/profile.py lines 92, 93 and 112.

Let us know how these work for you.

Regards,
Lia.

Hannelore Aerts

unread,
Apr 3, 2015, 9:59:31 AM4/3/15
to tvb-...@googlegroups.com
Hi Lia,

I managed to import the required modules by updating the github repo. Thank you very much!

Kind regards,
Hannelore
Reply all
Reply to author
Forward
0 new messages