alliedvision / VimbaPython

Old Allied Vision Vimba Python API. The successor to this API is VmbPy
BSD 2-Clause "Simplified" License
93 stars 40 forks source link

'No TL detected. Please verify Vimba installation.' #163

Open imihassan opened 1 year ago

imihassan commented 1 year ago

I am trying to use VimbaPython with USB3 for automatically saving images from USB3 ALV camera 1800-2050c. To run the script in the start I added the python script to sudo crontab -e as @reboot sleep 60 && python3 /home/aies/Downloads/Vimba64_v6.0_Linux/Vimba_6_0/VimbaPython/Examples/asynchronous_grab_opencv.py >> /home/aies/Downloads/Vimba64_v6.0_Linux/Vimba_6_0/VimbaPython/Examples/>

It gives error

Traceback (most recent call last): File "asynchronous_grab_opencv.py", line 31, in <module> from vimba import * File "/usr/local/lib/python3.8/dist-packages/vimba/__init__.py", line 104, in <module> from .vimba import Vimba File "/usr/local/lib/python3.8/dist-packages/vimba/vimba.py", line 30, in <module> from .c_binding import call_vimba_c, VIMBA_C_VERSION, VIMBA_IMAGE_TRANSFORM_VERSION, \ File "/usr/local/lib/python3.8/dist-packages/vimba/c_binding/__init__.py", line 107, in <module> from .vimba_c import VmbInterface, VmbAccessMode, VmbFeatureData, \ File "/usr/local/lib/python3.8/dist-packages/vimba/c_binding/vimba_c.py", line 678, in <module> _lib_instance = _check_version(_attach_signatures(load_vimba_lib('VimbaC'))) File "/usr/local/lib/python3.8/dist-packages/vimba/c_binding/vimba_common.py", line 484, in load_vimba_lib return platform_handlers[sys.platform](vimba_project) File "/usr/local/lib/python3.8/dist-packages/vimba/c_binding/vimba_common.py", line 503, in _load_under_linux raise VimbaSystemError('No TL detected. Please verify Vimba installation.')

Note: I installed TL drivers using sudo. When I run program using command python3 asynchronous_grab_opencv.py it runs perfectly fine

but if I run using sudo python3 asynchronous_grab_opencv.py it gives the same error.

I need help to solve this problem

Teresa-AlliedVision commented 1 year ago

Hi, the API is looking for the paths in the GENICAM_GENTL64_PATH, you can check the saved paths of that variable with env. Some environmental variables are not available with sudo, but adding -E to the command should help.

 -E, --preserve-env
             Indicates to the security policy that the user wishes to preserve
             their existing environment variables.  The security policy may
             return an error if the user does not have permission to preserve
             the environment.

You can also try to reinstall the SDK.