[visionegg] Re: Using VisionEgg with LabPython

  • From: Chintan Trivedi <chintanbme@xxxxxxxxx>
  • To: visionegg@xxxxxxxxxxxxx
  • Date: Thu, 24 Sep 2009 19:28:54 +0200

Andrew,
There were a few minor syntax errors with the source code that you
corrected. I am listing them below.
Do incorporate these corrections in the new VE version.

if hasattr(sys.'argv') and sys.executable == sys.argv[0]: # Windows binary
Line 101 of config.py should be* "if hasattr(sys, 'argv')"*

if hasattr(sys,'argv'): and not sys.argv[0]: # Interactive mode
Line 108 of __init__.py should be  *"if hasattr(sys,'argv') and not
sys.argv[0]:"

*After these corrections, I could import the VisionEgg package into LabPython.
But as you guessed it is creating problems elsewhere as well. For
Example, I can import Screen and get_default_screen.
But using get_default_screen anywhere in the code causes the same
attribute error.

I am trying to work on it and figure out a way, but any help you could
offer would be very useful.

Thanks for the prompt response.

Best,
Chintan






On Wed, Sep 23, 2009 at 7:31 PM, Andrew Straw <astraw@xxxxxxxxxxx> wrote:

> Chintan Trivedi wrote:
> > Dear All,
> > I am trying to use VisionEgg with LabPython (i.e. Python in LabVIEW).
> > When I try to import Visionegg in Labpython I get the following error:
> >
> > <type 'exceptions.AttributeError'>, 'module' object has no attribute
> > 'argv'
> >
> > I do understand that this has something to do with the way sys.argv is
> > defined in the source code of Vision Egg.
> > Also Labpython can easily import other packages such as numpy or
> > PyGame, hence LabPython works perfectly fine.
> > VisionEgg is the only package it cannot import.
> >
> > Andrew, probably you would know how to get around this situation
> > better, since you wrote the source code.
> >
> > Any help would be wonderful!!
> >
> > Thanks,
> > Chintan Trivedi
> > Max Planck Institute for Medical Research
> > Heidelberg, Germany
> Hi Chintan,
>
> I made a couple changes that I think will fix the issue. Although it's a
> bit strange to me that the 'argv' attribute isn't part of the sys module
> -- it makes me wonder if there will be other troubles, too.
>
> Anyhow, the changes I made are here:
>
> http://github.com/visionegg/visionegg/commit/b5919389b3a3c9a3f1472fd132c146d69ecc3dc4
> this will be in the next release of the VE. In the meantime, can you
> simply modify those files in place?
>
> -Andrew
>
> --
> Andrew D. Straw, Ph.D.
> California Institute of Technology
> http://www.its.caltech.edu/~astraw/<http://www.its.caltech.edu/%7Eastraw/>
>
> ======================================
> The Vision Egg mailing list
> Archives: //www.freelists.org/archives/visionegg
> Website: http://www.visionegg.org/mailinglist.html
>



-- 
Chintan Trivedi
Max Planck Institute for Medical Research
Heidelberg, Germany

Other related posts: