[pymvpa] InteractiveShell object

Yaroslav Halchenko debian at onerussian.com
Tue Feb 26 17:05:55 UTC 2013


On Tue, 26 Feb 2013, Abduljalil Sireis wrote:

>      head ./test.py # in your shell
>      then ?

>    #!/usr/bin/env ipython
>    # -*- coding: utf-8 -*-
>    """
>    Spyder Editor
>    This temporary script file is located here:
>    /home/brain/.spyder2/.temp.py
>    """
>      > >...<
>    /home/brain/ipython scripts/test.py in <module>()
>         12 import mvpa2.suite as mvpa2
>         13 import IPython
>    ---> 14 IPython.embed()
>         15 
>         16 path = os.path.join('brain')

ho ho -- that might be the source of the problem (something spyder
injects having assumptions on ipython's version)

>      >    �what happens if you run it with pure python, not ipython, i.e.
>      >      python test.py
>      >      ?
>      >    AttributeError: 'module' object has no attribute 'embed'

>      so the same (thus not ipython-dependent), good

so I was wrong -- it is ipython dependent since script imports it ;)

>      >      > � �2. output of�print mvpa2.wtf()
>      >      that should be ran in (i)python interpreter (e.g. just start
>      ipython,
>      >      and
>      >      then type
>      >      mvpa2.wtf()
>      >      )
>      >      > � �bash: syntax error near unexpected token `('
>      >    �NameError: name 'mvpa2' is not defined

>      ;) ok -- first enter

>      import mvpa2

>    i entered  import mvpa2.suite as mvpa2
>    shouldn't that be enough? :-) 

should if import succeeds... now I see that we recommend this way in the
FAQ but I guess we better advise not to import 'as mvpa2' but better as
'as mv'.  

anyways -- if you imported it 'as mvpa2' and there were no errors you
must be able to

print mvpa2.wtf()

if it doesn't work -- again -- copy/paste entire "protocol of struggle"
not just the last error ;)  so just do

in your shell start ipython:

ipython

in ipython shell do

import mvpa2
print mvpa2.wtf()

it must work and it would provide us all information neeeded

-- 
Yaroslav O. Halchenko
http://neuro.debian.net http://www.pymvpa.org http://www.fail2ban.org
Postdoctoral Fellow,   Department of Psychological and Brain Sciences
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
Phone: +1 (603) 646-9834                       Fax: +1 (603) 646-1419
WWW:   http://www.linkedin.com/in/yarik        



More information about the Pkg-ExpPsy-PyMVPA mailing list