On 06/08/2020 09:31 AM, Christian Spindelberger via USRP-users wrote:
Hi,

I have a little problem with the Python API. I installed the UHD 3.15 driver from source. When I want to utilize the uhd.usrp.MultiUSRP() command it only works if I launch Python as normal user. If I open the Python environment with sudo it does not work anymore and I receive the following error:

Python 3.6.9 (default, Apr 18 2020, 01:56:04)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import uhd
>>> uhd.usrp.MultiUSRP()
[INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; UHD_3.15.0.0-44-g5a9f9ed9
[INFO] [X300] X300 initialization sequence...
[INFO] [X300] Maximum frame size: 1472 bytes.
[INFO] [X300] Radio 1x clock: 200 MHz
[INFO] [GPS] Found an internal GPSDO: LC_XO, Firmware Rev 0.929b
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/uhd/usrp.py", line 20, in __init__
    super(MultiUSRP, self).__init__(args)
RuntimeError: AssertionError: Failed to find a valid XML path for RFNoC blocks.
Try setting the enviroment variable UHD_RFNOC_DIR to the correct location


I have read in a former post that this might happen when the driver is installed with "make install", but I already reinstalled with "sudo make install" and the same problem remains.
Does anyone know why this happens?


Thank you,

Christian
Because when you "sudo" various variables, such as PYTHONPATH from your non-sudo environment are not inherited by the shell that
  "sudo" creates.  This is expected behavior.

There is normally no reason to run any of this stuff under sudo. None whatsoever. However, you can use the -E option on sudo to preserve
  your environment variables across a sudo call.



_______________________________________________
USRP-users mailing list
[email protected]
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com

Reply via email to