Post Go back to editing

AttributeError: /lib/x86_64-linux-gnu/libiio.so.1: undefined symbol: iio_get_backends_count

Category: Software

Hello,

We are trying to run the "ad9081_tdd_example.py" code using ZCU102+AD9081 (https://github.com/analogdevicesinc/pyadi-iio/blob/a5eb253aa30678fead58dae7df06b9a7dce3c1be/examples/ad9081_tdd_example.py#L14). But there is an error:

pci@pci-virtual-machine:~$ /bin/python3 /home/pci/Documents/ad9081_tdd_example.py
Traceback (most recent call last):
  File "/home/pci/Documents/ad9081_tdd_example.py", line 7, in <module>
    import adi
  File "/home/pci/.local/lib/python3.8/site-packages/adi/__init__.py", line 5, in <module>
    from adi.ad469x import ad469x
  File "/home/pci/.local/lib/python3.8/site-packages/adi/ad469x.py", line 10, in <module>
    from adi.context_manager import context_manager
  File "/home/pci/.local/lib/python3.8/site-packages/adi/context_manager.py", line 5, in <module>
    import iio
  File "/home/pci/.local/lib/python3.8/site-packages/iio.py", line 229, in <module>
    _get_backends_count = _lib.iio_get_backends_count
  File "/usr/lib/python3.8/ctypes/__init__.py", line 386, in __getattr__
    func = self.__getitem__(name)
  File "/usr/lib/python3.8/ctypes/__init__.py", line 391, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /lib/x86_64-linux-gnu/libiio.so.1: undefined symbol: iio_get_backends_count

 I run the above code on the VMware Ubuntu 20.04, Python 3.8.

Could you help us with this?

Thanks,

Dongyu

  • Hi,

    Please check your libiio version using iio_info -V
    You should use v0.25. If the installed version is v1.0 then you should uninstall it and install the v0.25 release.

    Thank you!
    -Alexandra

  • Hi Alexandra,

    my libiio version is v0.25

    Thanks,

    DOngyu

  • Hi,

    From the error above it looks like there might be some files left behind from a previous libiio v1.0 install.

    AttributeError: /lib/x86_64-linux-gnu/libiio.so.1: undefined symbol: iio_get_backends_count

    Could you also check the iio version reported by python? For that you need to run the python interpreter and then use:

    import iio; print(iio.version)

    Thank you!
    -Alexandra

  • Hi Alexabdra,

    When I import iio, there is an error:

    pci@pci-virtual-machine:~/gr-dymod/build$ python3
    Python 3.8.10 (default, Nov 22 2023, 10:22:35)
    [GCC 9.4.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import iio
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/home/pci/.local/lib/python3.8/site-packages/iio.py", line 229, in <module>
        _get_backends_count = _lib.iio_get_backends_count
      File "/usr/lib/python3.8/ctypes/__init__.py", line 386, in __getattr__
        func = self.__getitem__(name)
      File "/usr/lib/python3.8/ctypes/__init__.py", line 391, in __getitem__
        func = self._FuncPtr((name_or_ordinal, self))
    AttributeError: /lib/x86_64-linux-gnu/libiio.so.1: undefined symbol: iio_get_backends_count

    but when I try to re-install the packages, it shows that I already installed them:

    What should I do? I do installed the libiio v1.0 before and then I re-install the v0.25. How can I remove the v1.0? Is it not overwritten? 

    Thanks,

    Dongyu

  • Hi,

    You should try to run pip uninstall on both pylibiio and pyadi-iio. Then try to run the following python command again: import iio; print(iio.version).
    If everything is properly uninstalled. then it should print that no such module is available. If you still get an error, then you need to manually remove anything related to libiio python bindings from /home/pci/.local/lib/python3.8/site-packages .

    Also go to :  /lib/x86_64-linux-gnu and remove libiio.so.1. It was not properly overwritten because the libraries have 2 different versions and you just replaced a part of the entire project when you reinstalled 0.25.

    After everything is clean reinstall pylibiio and pyadi-iio using pip.

    -Alexandra

  • hey, i have the same issue. Tried everything you said in this thread and still getting the error:
    >>> import adi
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/home/user/new_sdr_project/lib/python3.10/site-packages/adi/__init__.py", line 5, in <module>
        from adi.ad469x import ad469x
      File "/home/user/new_sdr_project/lib/python3.10/site-packages/adi/ad469x.py", line 10, in <module>
        from adi.context_manager import context_manager
      File "/home/user/new_sdr_project/lib/python3.10/site-packages/adi/context_manager.py", line 5, in <module>
        import iio
      File "/home/user/new_sdr_project/lib/python3.10/site-packages/iio.py", line 227, in <module>
        _lib = _cdll(find_library(_iiolib), use_errno=True, use_last_error=True)
      File "/usr/lib/python3.10/ctypes/__init__.py", line 374, in __init__
        self._handle = _dlopen(self._name, mode)
    OSError: libiio.so.1: cannot open shared object file: No such file or directory


    i am running on jetson orin nano and ubuntu 22.04
    thanks, in advanced