discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: uhd.find_devices() - AttributeError


From: Marcus Müller
Subject: Re: uhd.find_devices() - AttributeError
Date: Wed, 6 Mar 2024 01:44:21 +0100
User-agent: Mozilla Thunderbird

Hi Trung Trieu,

I can reproduce this, by running `podman run --rm -it ubuntu:22.04`, and in 
there

apt update; apt install -y gnuradio;
python3 -c 'from gnuradio import uhd;uhd.find_devices()'

so you're not alone!

The honest truth is that this line has been there since GNU Radio 3.4.2 , and as you can see, nobody remembered to remove it when it became dysfunctional. Oops!

For you, I'd have a workaround. Try this:

from gnuradio import uhd
from uhd import find as find_devices

find_devices("")

Best regards,
Marcus

On 05.03.24 22:56, Trung Trieu wrote:
Hello all,

I've been having some issues with gnuradio 3.10 and still haven't figured
it out yet. I'd really appreciate it if anyone could help me or have any
pointers that I can follow.

For your reference, I have an Ubuntu 22 virtual machine running on VMware
and installed gnuradio (as well as other dependencies) from the
instructions at https://wiki.gnuradio.org/index.php/InstallingGR (I tried
both installation methods via apt and via ppa but no luck).

The error message I have is:

-----------------------------------------------------------------
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/usr/lib/python3/dist-packages/gnuradio/uhd/__init__.py", line 73,
in find_devices
     return __builtins__['map'](to_pythonized_dev_addr,
uhd_python.find_devices_raw(*args, **kwargs))
AttributeError: module 'gnuradio.uhd.uhd_python' has no attribute
'find_devices_raw'. Did you mean: 'find_devices'?
-----------------------------------------------------------------

Steps to reproduce:
1. Install gnuradio 3.10
2. From the command line, launch python3 by typing "python3"
     - >>> from gnuradio import uhd
     - >>> print(uhd.find_devices())
That's where the error occurs.

The content of '/usr/lib/python3/dist-packages/gnuradio/uhd/__init__.py'
can also be found at
https://github.com/gnuradio/gnuradio/blob/master/gr-uhd/python/uhd/__init__.py

Note that I don't have this issue with Ubuntu 20, which uses gruradio 3.8
and SWIG instead of PyBind11. So instead of 'uhd_python', it'll be
'uhd_swig' from the above error message. The code with gnuradio 3.8 can
also be found at
https://github.com/gnuradio/gnuradio/blob/maint-3.8/gr-uhd/python/uhd/__init__.py

Thank you all in advance!!
*Trung Trieu*




reply via email to

[Prev in Thread] Current Thread [Next in Thread]