Yarp & Python ?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Yarp & Python ?

Stéphane Lallée
Hi,

I'm trying to use the Python binding to YARP.
I got the /yarp2/example/swig compiled successfuly.
But when I try to run example.py I get the error :

C:\Stephane\yarp\yarp2\example\swig\Release>example.py
Traceback (most recent call last):
  File "C:\Stephane\yarp\yarp2\example\swig\Release\example.py", line 3, in <
module>
    import yarp
  File "C:\Stephane\yarp\yarp2\example\swig\yarp.py", line 7, in <module>
    import _yarp
ImportError: No module named _yarp


Has someone already used Python to call yarp ?

Cheers,
--
Stéphane Lallée

Stem Cell and Brain Research Institute
INSERM U846
Department of Integrative Neuroscience
18, avenue Doyen Lépine
69675 Bron Cedex

tel : (00 33) (0) 6 28 228 462
tel (labo) : (00 33) (0) 4 72 913 441

www.sbri.fr


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Yarp & Python ?

paulfitz
Administrator

>
> I'm trying to use the Python binding to YARP.
> I got the /yarp2/example/swig compiled successfuly.
> But when I try to run example.py I get the error :
>
> *C:\Stephane\yarp\yarp2\example\swig\Release>example.py
> Traceback (most recent call last):
>   File "C:\Stephane\yarp\yarp2\example\swig\Release\example.py", line
> 3, in <
> module>
>     import yarp
>   File "C:\Stephane\yarp\yarp2\example\swig\yarp.py", line 7, in <module>
>     import _yarp
> ImportError: No module named _yarp*
>
> Has someone already used Python to call yarp ?

Hi Stephane,

Try replacing the following line in CMakeLists.txt:
   SWIG_ADD_MODULE(libpyyarp python yarp.i)
with:
   SWIG_ADD_MODULE(yarp python yarp.i)

I get the same problems as you with the libpyyarp line in place.

Does anyone know a situation (a different SWIG or CMake version, for
example) in which libpyyarp is the right thing to have?

Cheers,
Paul



------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Yarp & Python ?

Stéphane Lallée
Hi Paul,

Unfortunately I still have the same error... (btw, I'm under windows XP)

Cheers,
Stéphane


2009/3/2 Paul Fitzpatrick <[hidden email]>


I'm trying to use the Python binding to YARP.
I got the /yarp2/example/swig compiled successfuly.
But when I try to run example.py I get the error :

*C:\Stephane\yarp\yarp2\example\swig\Release>example.py
Traceback (most recent call last):
 File "C:\Stephane\yarp\yarp2\example\swig\Release\example.py", line 3, in <
module>
   import yarp
 File "C:\Stephane\yarp\yarp2\example\swig\yarp.py", line 7, in <module>
   import _yarp
ImportError: No module named _yarp*

Has someone already used Python to call yarp ?

Hi Stephane,

Try replacing the following line in CMakeLists.txt:
 SWIG_ADD_MODULE(libpyyarp python yarp.i)
with:
 SWIG_ADD_MODULE(yarp python yarp.i)

I get the same problems as you with the libpyyarp line in place.

Does anyone know a situation (a different SWIG or CMake version, for example) in which libpyyarp is the right thing to have?
Cheers,
Paul





--
Stéphane Lallée

Stem Cell and Brain Research Institute
INSERM U846
Department of Integrative Neuroscience
18, avenue Doyen Lépine
69675 Bron Cedex

tel : (00 33) (0) 6 28 228 462
tel (labo) : (00 33) (0) 4 72 913 441

www.sbri.fr


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Yarp & Python ?

paulfitz
Administrator
Hi Stephane,

Try copying any generated files in the subdirectory Debug or Release up
one level (especially anything called _yarp.lib and/or _yarp.dll), to be
in the same directory as example.py.

In fact, make sure to compile in Release mode in case the generated
library name gets an extra "d" in it under debug mode.  I don't think
this python stuff has been tested on Windows.

Cheers,
Paul

Stéphane Lallée wrote:

> Hi Paul,
>
> Unfortunately I still have the same error... (btw, I'm under windows XP)
>
> Cheers,
> Stéphane
>
>
> 2009/3/2 Paul Fitzpatrick <[hidden email]
> <mailto:[hidden email]>>
>
>
>
>         I'm trying to use the Python binding to YARP.
>         I got the /yarp2/example/swig compiled successfuly.
>         But when I try to run example.py I get the error :
>
>         *C:\Stephane\yarp\yarp2\example\swig\Release>example.py
>         Traceback (most recent call last):
>          File
>         "C:\Stephane\yarp\yarp2\example\swig\Release\example.py", line
>         3, in <
>         module>
>            import yarp
>          File "C:\Stephane\yarp\yarp2\example\swig\yarp.py", line 7,
>         in <module>
>            import _yarp
>         ImportError: No module named _yarp*
>
>         Has someone already used Python to call yarp ?
>
>
>     Hi Stephane,
>
>     Try replacing the following line in CMakeLists.txt:
>      SWIG_ADD_MODULE(libpyyarp python yarp.i)
>     with:
>      SWIG_ADD_MODULE(yarp python yarp.i)
>
>     I get the same problems as you with the libpyyarp line in place.
>
>     Does anyone know a situation (a different SWIG or CMake version,
>     for example) in which libpyyarp is the right thing to have?
>     Cheers,
>     Paul
>
>
>
>
>
> --
> Stéphane Lallée
>
> Stem Cell and Brain Research Institute
> INSERM U846
> Department of Integrative Neuroscience
> 18, avenue Doyen Lépine
> 69675 Bron Cedex
>
> tel : (00 33) (0) 6 28 228 462
> tel (labo) : (00 33) (0) 4 72 913 441
>
> www.sbri.fr <http://www.sbri.fr>
>


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Yarp & Python ?

Stéphane Lallée
Ok, it seem to work.
I still get a lot of syntax error, but it seems to be related to my python version (example : "raise AttributeError, name" has to be written " raise(AttributeError,name) ")
Don't worry, I'll tell you if something is wrong under windows ;-)

Thanks Paul !
Stéphane

2009/3/3 Paul Fitzpatrick <[hidden email]>
Hi Stephane,

Try copying any generated files in the subdirectory Debug or Release up one level (especially anything called _yarp.lib and/or _yarp.dll), to be in the same directory as example.py.

In fact, make sure to compile in Release mode in case the generated library name gets an extra "d" in it under debug mode.  I don't think this python stuff has been tested on Windows.

Cheers,
Paul

Stéphane Lallée wrote:
Hi Paul,

Unfortunately I still have the same error... (btw, I'm under windows XP)

Cheers,
Stéphane


2009/3/2 Paul Fitzpatrick <[hidden email] <mailto:[hidden email]>>




       I'm trying to use the Python binding to YARP.
       I got the /yarp2/example/swig compiled successfuly.
       But when I try to run example.py I get the error :

       *C:\Stephane\yarp\yarp2\example\swig\Release>example.py
       Traceback (most recent call last):
        File
       "C:\Stephane\yarp\yarp2\example\swig\Release\example.py", line
       3, in <
       module>
          import yarp
        File "C:\Stephane\yarp\yarp2\example\swig\yarp.py", line 7,
       in <module>
          import _yarp
       ImportError: No module named _yarp*

       Has someone already used Python to call yarp ?


   Hi Stephane,

   Try replacing the following line in CMakeLists.txt:
    SWIG_ADD_MODULE(libpyyarp python yarp.i)
   with:
    SWIG_ADD_MODULE(yarp python yarp.i)

   I get the same problems as you with the libpyyarp line in place.

   Does anyone know a situation (a different SWIG or CMake version,
   for example) in which libpyyarp is the right thing to have?
   Cheers,
   Paul





--
Stéphane Lallée

Stem Cell and Brain Research Institute
INSERM U846
Department of Integrative Neuroscience
18, avenue Doyen Lépine
69675 Bron Cedex

tel : (00 33) (0) 6 28 228 462
tel (labo) : (00 33) (0) 4 72 913 441

www.sbri.fr <http://www.sbri.fr>





--
Stéphane Lallée

Stem Cell and Brain Research Institute
INSERM U846
Department of Integrative Neuroscience
18, avenue Doyen Lépine
69675 Bron Cedex

tel : (00 33) (0) 6 28 228 462
tel (labo) : (00 33) (0) 4 72 913 441

www.sbri.fr


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Yarp & Python ?

Stéphane Lallée
No... I corrected all the errors (or upgrade to the latest version of SWIG correct that too) but I still get this :
ImportError: No module named _yarp

Even with _yarp.dll (.lib, .exp, .idb ) in the same directory...

Did someone tried to use this python bindings under windows ?



2009/3/3 Stéphane Lallée <[hidden email]>
Ok, it seem to work.
I still get a lot of syntax error, but it seems to be related to my python version (example : "raise AttributeError, name" has to be written " raise(AttributeError,name) ")
Don't worry, I'll tell you if something is wrong under windows ;-)

Thanks Paul !
Stéphane

2009/3/3 Paul Fitzpatrick <[hidden email]>

Hi Stephane,

Try copying any generated files in the subdirectory Debug or Release up one level (especially anything called _yarp.lib and/or _yarp.dll), to be in the same directory as example.py.

In fact, make sure to compile in Release mode in case the generated library name gets an extra "d" in it under debug mode.  I don't think this python stuff has been tested on Windows.

Cheers,
Paul

Stéphane Lallée wrote:
Hi Paul,

Unfortunately I still have the same error... (btw, I'm under windows XP)

Cheers,
Stéphane


2009/3/2 Paul Fitzpatrick <[hidden email] <mailto:[hidden email]>>




       I'm trying to use the Python binding to YARP.
       I got the /yarp2/example/swig compiled successfuly.
       But when I try to run example.py I get the error :

       *C:\Stephane\yarp\yarp2\example\swig\Release>example.py
       Traceback (most recent call last):
        File
       "C:\Stephane\yarp\yarp2\example\swig\Release\example.py", line
       3, in <
       module>
          import yarp
        File "C:\Stephane\yarp\yarp2\example\swig\yarp.py", line 7,
       in <module>
          import _yarp
       ImportError: No module named _yarp*

       Has someone already used Python to call yarp ?


   Hi Stephane,

   Try replacing the following line in CMakeLists.txt:
    SWIG_ADD_MODULE(libpyyarp python yarp.i)
   with:
    SWIG_ADD_MODULE(yarp python yarp.i)

   I get the same problems as you with the libpyyarp line in place.

   Does anyone know a situation (a different SWIG or CMake version,
   for example) in which libpyyarp is the right thing to have?
   Cheers,
   Paul





--
Stéphane Lallée

Stem Cell and Brain Research Institute
INSERM U846
Department of Integrative Neuroscience
18, avenue Doyen Lépine
69675 Bron Cedex

tel : (00 33) (0) 6 28 228 462
tel (labo) : (00 33) (0) 4 72 913 441

www.sbri.fr <http://www.sbri.fr>





--
Stéphane Lallée

Stem Cell and Brain Research Institute
INSERM U846
Department of Integrative Neuroscience
18, avenue Doyen Lépine
69675 Bron Cedex

tel : (00 33) (0) 6 28 228 462
tel (labo) : (00 33) (0) 4 72 913 441

www.sbri.fr




--
Stéphane Lallée

Stem Cell and Brain Research Institute
INSERM U846
Department of Integrative Neuroscience
18, avenue Doyen Lépine
69675 Bron Cedex

tel : (00 33) (0) 6 28 228 462
tel (labo) : (00 33) (0) 4 72 913 441

www.sbri.fr


------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Robotcub-hackers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/robotcub-hackers
Loading...