ImportError: No module named IcePy in Raspberry Pi

pgaleaspgaleas ChilePatricio GaleasOrganization: Universidad de La FronteraMember

Hello,
I'm newby with Ice and I'm trying to run the python "Hello World" in my RaspberryPi.

I build a core-image-base (Yocto) with the following BBLAYERS:

BBLAYERS ?= " \
/home/jon/software/yocto/poky-jethro-2.0/meta \
/home/jon/software/yocto/poky-jethro-2.0/meta-yocto \
/home/jon/software/yocto/poky-jethro-2.0/meta-yocto-bsp \
/home/jon/software/yocto/meta-openembedded/meta-oe \
/home/jon/software/yocto/meta-openembedded/meta-filesystems \
/home/jon/software/yocto/meta-openembedded/meta-networking \
/home/jon/software/yocto/meta-openembedded/meta-python \
/home/jon/software/yocto/meta-sdr \
/home/jon/software/yocto/meta-raspberrypi \
"

I have the Server demo running on a standardr PC (java) of the same network.

When a run the Client.py in my Raspberry I get the following Error:

Traceback (most recent call last):
  File "Client.py", line 1, in <module>
    import Ice
  File "/usr/lib/python2.7/site-packages/Ice.py", line 47, in <module>
    import IcePy
ImportError: No module named IcePy

My sys.path print out:

[email protected]:~/development/python# python
Python 2.7.9 (default, Oct 26 2016, 17:30:13) 
[GCC 5.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/usr/lib/python27.zip', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/lib/python2.7/site-packages', '/usr/lib/python2.7/site-packages/gtk-2.0']
>>> 

What I'm doing wrong?

Best regards
PGaleas

Best Answer

  • joegeorgejoegeorge Jupiter, FloridaJoe GeorgeOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    edited November 2016 Accepted Answer

    This is an issue with the meta-zeroc layer. The extension should be named IcePy.so and not IcePy.so.3.6.3. I've updated our layer with a fix for this.

    Please let me know if this resolves your issue.

Answers

  • joegeorgejoegeorge Jupiter, FloridaJoe GeorgeOrganization: ZeroC, Inc.Project: IceAdministrators, ZeroC Staff ZeroC Staff

    Hi PGaleas,

    It doesn't look like you are using our meta layer. You can find instructions for including our meta-layer on the Using Ice-E with Yocto page of our documenation.

    You will also need to be sure you're including our python package as part of your build. Your local.conf file should contain:

    IMAGE_INSTALL_append = " zeroc-ice zeroc-ice-python"
    

    Cheers,
    Joe

  • pgaleaspgaleas ChilePatricio GaleasOrganization: Universidad de La FronteraMember

    Hi Joe,

    I actually followed the instructions you mentioned. I copied an old BBLayer definition in my last post (sorry for the confusion).

    So, my actual BBLAYERS includes meta-zeroc at the end of the string":

    BBLAYERS ?= " \
      /home/pgaleas/software/yocto/poky-jethro-2.0/meta \
      /home/pgaleas/software/yocto/poky-jethro-2.0/meta-yocto \
      /home/pgaleas/software/yocto/poky-jethro-2.0/meta-yocto-bsp \
      /home/pgaleas/software/yocto/meta-openembedded/meta-oe \
      /home/pgaleas/software/yocto/meta-openembedded/meta-filesystems \
      /home/pgaleas/software/yocto/meta-openembedded/meta-networking \
      /home/pgaleas/software/yocto/meta-openembedded/meta-python \
      /home/pgaleas/software/yocto/meta-raspberrypi \
      /home/pgaleas/software/yocto/meta-sdr \
      /home/pgaleas/software/yocto/meta-zeroc \ 
    "
    

    I also include in following lines in the local.conf

    IMAGE_INSTALL_append = " zeroc-ice zeroc-ice-python"
    TOOLCHAIN_TARGET_TASK_append = " zeroc-ice-dev zeroc-ice-staticdev"
    TOOLCHAIN_HOST_TASK_append  = " nativesdk-zeroc-ice-dev"
    

    The Raspberry's folder /usr/lib/python2.7/site-packages contains the file IcePy.so.3.6.3
    But when I try to import the Ice library in the python console, I got the same error I mentioned before:

    [email protected]:/usr/lib/python2.7/site-packages# python
    Python 2.7.9 (default, Oct 26 2016, 17:30:13) 
    [GCC 5.2.0] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import Ice
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "Ice.py", line 47, in <module>
        import IcePy
    ImportError: No module named IcePy
    

    Any idea?
    Thank you for the response.

    Cheers
    PGaleas

  • joegeorgejoegeorge Jupiter, FloridaJoe GeorgeOrganization: ZeroC, Inc.Project: IceAdministrators, ZeroC Staff ZeroC Staff
    edited November 2016 Accepted Answer

    This is an issue with the meta-zeroc layer. The extension should be named IcePy.so and not IcePy.so.3.6.3. I've updated our layer with a fix for this.

    Please let me know if this resolves your issue.

  • pgaleaspgaleas ChilePatricio GaleasOrganization: Universidad de La FronteraMember

    It works!
    Thanks Joe.

Sign In or Register to comment.