This forum has been archived. Please start a new discussion on GitHub.

Python import error

I installed Ice on Ubuntu 14.04 following the directions on the download page, however, when I try to run one of the ice demos such as "minimal" I get this error:
Traceback (most recent call last):
  File "", line 11, in <module>
    import sys, traceback, time, Ice
  File "/usr/lib/python2.7/dist-packages/", line 47, in <module>
    import IcePy
ImportError: /usr/lib/ undefined symbol: _ZN15IceUtilInternal13int64ToStringEl

When I first installed Ice last week everything worked fine, but now I get the above error. My only thought as to what has changed was maybe I did:
sudo apt-get update
sudo apt-get upgrade

I've tried to uninstall / purge / reinstall, but I still get the same ImportError.


  • xdm
    xdm La Coruña, Spain

    I was not able to reproduce this problem. Seems that somehow you have installed an Ice Python and Slice library that are incompatible.

    Can you check that you are actualy using the ZeroC repository for Ubuntu 14.04, the repository list file is, as noted in the instructions the file must be copied to /etc/apt/sources.list.d/ice-trusty.list

    If you are using the right repository, you can try to re-install the relevant packages:
    sudo apt-get remove --purge libice3.5++ libice3.5-python
    sudo apt-get install libice3.5++ libice3.5-python
  • Thank you for your response, I've tried redoing the repository list by:

    1. Removed the existing ice3.5-trusty.list file in /etc/apt/sources.list.d/
    2. Downloading it again using the following code
    cd /etc/apt/sources.list.d
    sudo wget
    sudo apt-get update
    3. Finally removing and downloading the relevant packages as you suggested.
    sudo apt-get remove --purge libice3.5++ libice3.5-python
    sudo apt-get install libice3.5++ libice3.5-python

    Sadly I still get the same error message. I confirmed that the ice3.5-trusty.list file in /etc/apt/sources.list.d does include:
    # /etc/apt/sources.list.d/ice3.5-raring.list
    deb trusty-zeroc main
    deb-src trusty-zeroc main
  • xdm
    xdm La Coruña, Spain
    What architecture are you using 32 or 64 bits?

    Can you post the output of this command:
    ldd /usr/lib/python2.7/dist-packages/
  • I'm using 64 bit.

    Here's the output:
   =>  (0x00007fff44cb3000)
   => /usr/lib/x86_64-linux-gnu/ (0x00007f0cb8ad6000)
   => /usr/lib/ (0x00007f0cb87a8000)
   => /usr/lib/x86_64-linux-gnu/ (0x00007f0cb8568000)
   => /usr/lib/x86_64-linux-gnu/ (0x00007f0cb8264000)
   => /lib/x86_64-linux-gnu/ (0x00007f0cb804e000)
   => /lib/x86_64-linux-gnu/ (0x00007f0cb7e2f000)
   => /lib/x86_64-linux-gnu/ (0x00007f0cb7a69000)
   => /lib/x86_64-linux-gnu/ (0x00007f0cb7859000)
   => /lib/x86_64-linux-gnu/ (0x00007f0cb7654000)
   => /usr/lib/x86_64-linux-gnu/ (0x00007f0cb73cb000)
   => /lib/x86_64-linux-gnu/ (0x00007f0cb71c3000)
   => /lib/x86_64-linux-gnu/ (0x00007f0cb6ebc000)
            /lib64/ (0x00007f0cb9375000)
  • xdm
    xdm La Coruña, Spain
    I was finally able to reproduce this in a 64 bit setup, seems that you have installed libslice35 from Ubuntu repository and that is incompatible with the one provided by ZeroC repository.

    If you want to stick with ZeroC packages you should remove the other package:
    sudo apt-get remove --purge libslice35

    Note that this package was most likely installed as a dependency by other packages, so you will want to remove the other packages too. If you cannot remove the other packages that depend in Ubuntu Ice packages you will need to remove ZeroC ice packages and use the packages provided by Ubuntu to avoid conflicts.
  • I appreciate the assistance, I assume the package that installed libslice from the ubuntu repository was mumble-server. I'm not sure if these use ice, but the other packages I installed were: (node, php, rabbitmq, nginx, postgresql).

    I would like to keep ice working with python 2.7, would libslice from the ubuntu repository allow that? If not, do you have any suggestions as to how I keep it working with python 2.7 and also keep the mumble-server package?
  • xdm
    xdm La Coruña, Spain
    I see, mumble-server depends on libzeroc-ice35 and libiceutil35. and the conflict is with an IceUtil symbol probably because Ubuntu packages are build with C++11 enabled and ZeroC packages are not.

    If you want to keep mumble-server package, you can use python-zeroc-ice from Ubuntu repository that should work with python2.7. If you go this route first uninstall packages from ZeroC repository to avoid further conflicts.

    If you want to keep ZeroC packages you will need to recreate mumble-server packages to depend on ZeroC Ice packages.
  • Thank you very much, installing python-zeroc-ice seemed to do the trick.

    When you say to uninstall the packages from the zeroc repository, do you mean just the ones that python-zeroc-ice replaces or the whole ice package?
  • xdm
    xdm La Coruña, Spain
    Glad it worked, if you are using Ubuntu packages you don't need ZeroC packages, both repositories provide Ice-3.5.1 packages, just different builds and packages-names is better to not mix packages from both repositories.