PicoVNA5 API : ModuleNotFoundError: No module named '_vna_python'

Discussions forum for our Sampling Oscilloscopes, VNA, and Pulse Generators
Post Reply
PicoVNA_User
User
User
Posts: 2
Joined: Thu Jan 11, 2024 8:43 am

PicoVNA5 API : ModuleNotFoundError: No module named '_vna_python'

Post by PicoVNA_User »

Hello,

I tried using the PicoVNA5 API on Linux but encountered some issues running the examples given in the SDK. First thing I'd like to adress is that the Github link given in the Programmer's Guide does not work ( https://github.com/AAI-Robotics/PicoVNA5_SDK_Examples ). It might be easier to track these kind of issues with the Github up and running.

Setup:
PicoTech-issued PicoVNA5 SDK v5.2.5

Steps to reproduce:
- Install PicoVNA5 with the given picovna.run installation script
- Download SDK
- Decompress and change directory to the root of the SDK
- Install vna python module with

Code: Select all

pip install vna
- Run the sample code 01_simple_frequency_sweep.py with

Code: Select all

LD_LIBRARY_PATH=python/linux_x64/libvna.so python3 examples/api/python/01_simple_frequency_sweep/01_simple_frequency_sweep.py
Expected result: Code should run properly
Actual result:

Code: Select all

  File "examples/api/python/01_simple_frequency_sweep/01_simple_frequency_sweep.py", line 25, in 
 from vna import vna
File "/home/[i]user[/i]/.local/lib/python3.8/site-packages/vna/vna.py", line 13, in 
 import _vna_python
ModuleNotFoundError: No module named '_vna_python'
I tried

Code: Select all

LD_LIBRARY_PATH=python/linux_x64/
and

Code: Select all

LD_LIBRARY_PATH=python/linux_x64/_vna_python.so 
and both gave the same results.

Regards,

M-Dawg
Newbie
Posts: 0
Joined: Wed Aug 31, 2022 5:55 pm

Re: PicoVNA5 API : ModuleNotFoundError: No module named '_vna_python'

Post by M-Dawg »

Hello,

Thanks for your question.

The examples have migrated to: https://github.com/picotech/picovna5-examples We'll get the outdated link the Programmer's Guide updated.

The error appears to indicate that _vna_python.so cannot be found (or is not compatible with your system). Possible causes include one of the libraries not being present, readable, or being built for an incompatible architecture. One possibility is that you may also need to set PYTHONPATH -- running from the root directory of the SDK:

Code: Select all

PYTHONPATH=python/linux_x64 LD_LIBRARY_PATH=python/linux_x64 python3 examples/api/python/01_simple_frequency_sweep/01_simple_frequency_sweep.py
If that does not resolve the issue, please could you confirm your operating system and the version of python3 that you are using? Is your Python install 32- or 64-bit?

PicoVNA_User
User
User
Posts: 2
Joined: Thu Jan 11, 2024 8:43 am

Re: PicoVNA5 API : ModuleNotFoundError: No module named '_vna_python'

Post by PicoVNA_User »

Adding

Code: Select all

PYTHONPATH=python/linux_x64  
is exactly what fixed this issue. I managed to run a sample code, thank you very much !

M-Dawg
Newbie
Posts: 0
Joined: Wed Aug 31, 2022 5:55 pm

Re: PicoVNA5 API : ModuleNotFoundError: No module named '_vna_python'

Post by M-Dawg »

Thank you for updating us! Glad it's working :)

Post Reply