Closed CarlosHdezUAH closed 4 months ago
Had the same issue. Uninstall numpy v2.0.0, and install numpy v1.x.x. I'm running v1.26.4, and the python api works fine.
Had the same issue. Uninstall numpy v2.0.0, and install numpy v1.x.x. I'm running v1.26.4, and the python api works fine.
Thanks! I tried that a couple of times til it worked. :)
I am interested in installing UHD with the python API with this configuration: 2 x310 with TwinRX with an Octoclock. I have installed UHD with the following commands, exactly I have installed v4.6.0.0.0. I have Ubuntu 22.04 with Python 3.10.12.
sudo apt-get install git cmake libboost-all-dev libusb-1.0-0-dev python3-docutils python3-mako python3-numpy python3-requests python3-ruamel.yaml python3-setuptools build-essential cd ~ git clone https://github.com/EttusResearch/uhd.git cd uhd/host mkdir build cd build cmake -DENABLE_TESTS=OFF -DENABLE_C_API=OFF -DENABLE_PYTHON_API=ON -DENABLE_MANUAL=OFF .. make -j8 sudo make install sudo ldconfig
When I install it I try to run the following code and it works correctly
import uhd usrp = uhd.usrp.MultiUSRP() samples = usrp.recv_num_samps(1000000, 100e6, 1e6, [3], 50) # units: N, Hz, Hz, list of channel IDs, d print(samples[0:10])
When I go to install matplotlib to make a more complex code to display the spectrum and re-run the same code I get this error
A module that was compiled using NumPy 1.x cannot be run in NumPy 2.0.0 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0. Some module may need to rebuild instead e.g. with 'pybind11>=2.12'. If you are a user of the module, the easiest solution will be to downgrade to 'numpy<2' or try to upgrade the affected module. We expect that some modules will need time to support NumPy 2. Traceback (most recent call last): File "/home/lab/Escritorio/codigos_python/prueba2.py", line 1, in <module> import uhd File "/usr/local/lib/python3.10/site-packages/uhd/__init__.py", line 10, in <module> from . import types File "/usr/local/lib/python3.10/site-packages/uhd/types.py", line 10, in <module> from . import libpyuhd as lib AttributeError: _ARRAY_API not found [INFO] [UHD] linux; GNU C++ version 11.4.0; Boost_107400; UHD_4.6.0.0-0-unknown [INFO] [X300] X300 initialization sequence... [INFO] [X300] Maximum frame size: 8000 bytes. [INFO] [X300] Radio 1x clock: 200 MHz [WARNING] [RFNOC::GRAPH] One or more blocks timed out during flush! Violación de segmento (core' generado)
Any code I try with uhd from now on gives me this error. I have tried uninstalling matplotlib with pip but it still happens. How can I proceed? Do you recommend any ubuntu/python/uhd version configuration to make everything work correctly?