Intalling Python LCM in Ubuntu 11.10

836 views
Skip to first unread message

Rauldg

unread,
Mar 7, 2012, 5:58:16 AM3/7/12
to lcm-...@googlegroups.com
Hello,

I have problems trying to run the simplest example in Python 2.7. This is what I have done:

I installed LCM (./configure, make and make install)
Now I am trying to run the example in the Python Tutorial (http://lcm.googlecode.com/svn/www/reference/lcm/tut_python.html) but got stuck in the second step (Initializing LCM).

> import lcm

Raises:

>> import _lcm
>> ImportError: No module named _lcm

I think that the reason is that I have to do the lcm-python setup. So I do (in the lcm-python folder):

$ python setup.py build

Raises:
gcc: error: no se reconoce la opción ‘-pthread -I/usr/local/include -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include  ’

The error is in Spanish (sorry) it means "unrecognized option: ‘-pthread -I/usr/local/include -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include  ’ "

Can anyone give me any hint? Thank you very much


Raúl Domínguez

Rauldg

unread,
Mar 7, 2012, 6:57:15 AM3/7/12
to lcm-...@googlegroups.com
I also tried:

$ python setup.py install

And raises the same error:

gcc: error: no se reconoce la opción ‘-pthread -I/usr/local/include -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include  ’

Albert Huang

unread,
Mar 7, 2012, 9:47:12 AM3/7/12
to lcm-...@googlegroups.com
Hi Raul,

After you run "./configure", what does it say about Python support
being enabled or disabled?

If it says that python support is disabled, please ensure that the
packages recommended here are installed:
http://code.google.com/p/lcm/wiki/BuildInstructions

Specifically, check that 'python-dev' is installed.

Albert

> --
> You received this message because you are subscribed to the Google Groups
> "Lightweight Communications and Marshalling" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/lcm-users/-/aYs8dRKTWdgJ.
> To post to this group, send email to lcm-...@googlegroups.com.
> To unsubscribe from this group, send email to
> lcm-users+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/lcm-users?hl=en.

Rauldg

unread,
Mar 7, 2012, 10:17:08 AM3/7/12
to lcm-...@googlegroups.com
Hi Albert,

After ./configure:
Python Support:   Enabled

The python-dev and all recommended packages are installed.

After some changes I am stucked more or less at the same point (python terminal):

>> import lcm
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/lcm/__init__.py", line 3, in <module>
    import _lcm
ImportError: liblcm.so.1: cannot open shared object file: No such file or directory

I included in sys.path the path '/usr/local/lib' that is where liblcm.so.1 is located ... Any idea?

Thanks,
Raúl






El miércoles 7 de marzo de 2012 15:47:12 UTC+1, Albert escribió:
Hi Raul,

After you run "./configure", what does it say about Python support
being enabled or disabled?

If it says that python support is disabled, please ensure that the
packages recommended here are installed:
http://code.google.com/p/lcm/wiki/BuildInstructions

Specifically, check that 'python-dev' is installed.

Albert

> lcm-users+unsubscribe@googlegroups.com.


> For more options, visit this group at
> http://groups.google.com/group/lcm-users?hl=en.


El miércoles 7 de marzo de 2012 15:47:12 UTC+1, Albert escribió:
Hi Raul,

After you run "./configure", what does it say about Python support
being enabled or disabled?

If it says that python support is disabled, please ensure that the
packages recommended here are installed:
http://code.google.com/p/lcm/wiki/BuildInstructions

Specifically, check that 'python-dev' is installed.

Albert

> lcm-users+unsubscribe@googlegroups.com.


> For more options, visit this group at
> http://groups.google.com/group/lcm-users?hl=en.


El miércoles 7 de marzo de 2012 15:47:12 UTC+1, Albert escribió:
Hi Raul,

After you run "./configure", what does it say about Python support
being enabled or disabled?

If it says that python support is disabled, please ensure that the
packages recommended here are installed:
http://code.google.com/p/lcm/wiki/BuildInstructions

Specifically, check that 'python-dev' is installed.

Albert

> lcm-users+unsubscribe@googlegroups.com.


> For more options, visit this group at
> http://groups.google.com/group/lcm-users?hl=en.


El miércoles 7 de marzo de 2012 15:47:12 UTC+1, Albert escribió:
Hi Raul,

After you run "./configure", what does it say about Python support
being enabled or disabled?

If it says that python support is disabled, please ensure that the
packages recommended here are installed:
http://code.google.com/p/lcm/wiki/BuildInstructions

Specifically, check that 'python-dev' is installed.

Albert

> lcm-users+unsubscribe@googlegroups.com.


> For more options, visit this group at
> http://groups.google.com/group/lcm-users?hl=en.


El miércoles 7 de marzo de 2012 15:47:12 UTC+1, Albert escribió:
Hi Raul,

After you run "./configure", what does it say about Python support
being enabled or disabled?

If it says that python support is disabled, please ensure that the
packages recommended here are installed:
http://code.google.com/p/lcm/wiki/BuildInstructions

Specifically, check that 'python-dev' is installed.

Albert

> lcm-users+unsubscribe@googlegroups.com.


> For more options, visit this group at
> http://groups.google.com/group/lcm-users?hl=en.


El miércoles 7 de marzo de 2012 15:47:12 UTC+1, Albert escribió:
Hi Raul,

After you run "./configure", what does it say about Python support
being enabled or disabled?

If it says that python support is disabled, please ensure that the
packages recommended here are installed:
http://code.google.com/p/lcm/wiki/BuildInstructions

Specifically, check that 'python-dev' is installed.

Albert

> lcm-users+unsubscribe@googlegroups.com.


> For more options, visit this group at
> http://groups.google.com/group/lcm-users?hl=en.


El miércoles 7 de marzo de 2012 15:47:12 UTC+1, Albert escribió:
Hi Raul,

After you run "./configure", what does it say about Python support
being enabled or disabled?

If it says that python support is disabled, please ensure that the
packages recommended here are installed:
http://code.google.com/p/lcm/wiki/BuildInstructions

Specifically, check that 'python-dev' is installed.

Albert

> lcm-users+unsubscribe@googlegroups.com.


> For more options, visit this group at
> http://groups.google.com/group/lcm-users?hl=en.


El miércoles 7 de marzo de 2012 15:47:12 UTC+1, Albert escribió:
Hi Raul,

After you run "./configure", what does it say about Python support
being enabled or disabled?

If it says that python support is disabled, please ensure that the
packages recommended here are installed:
http://code.google.com/p/lcm/wiki/BuildInstructions

Specifically, check that 'python-dev' is installed.

Albert

> lcm-users+unsubscribe@googlegroups.com.


> For more options, visit this group at
> http://groups.google.com/group/lcm-users?hl=en.


El miércoles 7 de marzo de 2012 15:47:12 UTC+1, Albert escribió:
Hi Raul,

After you run "./configure", what does it say about Python support
being enabled or disabled?

If it says that python support is disabled, please ensure that the
packages recommended here are installed:
http://code.google.com/p/lcm/wiki/BuildInstructions

Specifically, check that 'python-dev' is installed.

Albert

On Wed, Mar 7, 2012 at 5:58 AM, Rauldgwrote:

> lcm-users+unsubscribe@googlegroups.com.

Albert Huang

unread,
Mar 7, 2012, 10:19:31 AM3/7/12
to lcm-...@googlegroups.com
Hi Raul,

Please follow _all_ of the instructions on that list. You probably
forgot to do the last one - "sudo ldconfig"

Albert

>> > lcm-users+...@googlegroups.com.

>> > lcm-users+...@googlegroups.com.

>> > lcm-users+...@googlegroups.com.

>> > lcm-users+...@googlegroups.com.

>> > lcm-users+...@googlegroups.com.

>> > lcm-users+...@googlegroups.com.

>> > lcm-users+...@googlegroups.com.

>> > lcm-users+...@googlegroups.com.

>> > lcm-users+...@googlegroups.com.


>> > For more options, visit this group at
>> > http://groups.google.com/group/lcm-users?hl=en.
>

> --
> You received this message because you are subscribed to the Google Groups
> "Lightweight Communications and Marshalling" group.
> To view this discussion on the web visit

> https://groups.google.com/d/msg/lcm-users/-/dn3pITvPkdgJ.


>
> To post to this group, send email to lcm-...@googlegroups.com.
> To unsubscribe from this group, send email to

> lcm-users+...@googlegroups.com.

Hordur Johannsson

unread,
Mar 7, 2012, 10:21:59 AM3/7/12
to lcm-...@googlegroups.com
Also if you installed to /usr/local you might need to
have /usr/local/lib in /etc/ld.so.conf.d/libc.conf
Hordur

Rauldg

unread,
Mar 8, 2012, 2:48:09 AM3/8/12
to lcm-...@googlegroups.com
Hi Albert, thanks.

You are right I was missing the "sudo ldconfig" command.


Raúl


El miércoles 7 de marzo de 2012 16:19:31 UTC+1, Albert escribió:
Hi Raul,

Please follow _all_ of the instructions on that list.  You probably


forgot to do the last one - "sudo ldconfig"

Albert

>> > lcm-users+unsubscribe@googlegroups.com.

>> > lcm-users+unsubscribe@googlegroups.com.

>> > lcm-users+unsubscribe@googlegroups.com.

>> > lcm-users+unsubscribe@googlegroups.com.

>> > lcm-users+unsubscribe@googlegroups.com.

>> > lcm-users+unsubscribe@googlegroups.com.

>> > lcm-users+unsubscribe@googlegroups.com.

>> > lcm-users+unsubscribe@googlegroups.com.

>> > lcm-users+unsubscribe@googlegroups.com.


>> > For more options, visit this group at
>> > http://groups.google.com/group/lcm-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Lightweight Communications and Marshalling" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/lcm-users/-/dn3pITvPkdgJ.
>
> To post to this group, send email to lcm-...@googlegroups.com.
> To unsubscribe from this group, send email to

> lcm-users+unsubscribe@googlegroups.com.

Luc Brunet

unread,
Mar 30, 2012, 11:17:24 AM3/30/12
to lcm-...@googlegroups.com
Hey guys, does anyone know if it is possible to add comments to struct
variables within an LCM type definition file?

i.e:

package exlcm;

struct example_t
{
/// comment for timestamp
int64_t timestamp;

/// comment for pose
double position[3];
double orientation[4];
int32_t num_ranges;
int16_t ranges[num_ranges];
string name;
boolean enabled;
}

Thanks,

Luc

Abe Bachrach

unread,
Mar 30, 2012, 11:24:26 AM3/30/12
to lcm-...@googlegroups.com
Use two forward slashes (like C)

For an example, see:
https://svn.csail.mit.edu/libbot2/bot2-core/lcmtypes/bot_core_pose_t.lcm

-=Abe

> --
> You received this message because you are subscribed to the Google Groups "Lightweight Communications and Marshalling" group.

> To post to this group, send email to lcm-...@googlegroups.com.

> To unsubscribe from this group, send email to lcm-users+...@googlegroups.com.

Luc Brunet

unread,
Mar 30, 2012, 11:25:45 AM3/30/12
to lcm-...@googlegroups.com
Thanks Abe,

Luc

Reply all
Reply to author
Forward
0 new messages