VimbaPython
VimbaPython copied to clipboard
API not started error VmbError.ApiNotStarted: -2
Have had very many issues getting this library to work.
I am running a Windows machine with a Guppy Pro camera and Anaconda 4.11 with python 3.9 and jupyter
This is my latest error and am not sure how to resolve this
---------------------------------------------------------------------------VimbaCError Traceback (most recent call last)~\VimbaPython_Source\vimba\camera.py in _open(self) 906 try:--> 907 call_vimba_c('VmbCameraOpen', self.__info.cameraIdString, self.__access_mode, 908 byref(self.__handle)) ~\VimbaPython_Source\vimba\util\tracer.py in wrapper(*args, **kwargs) 133 else:--> 134 return func(*args, **kwargs) 135 ~\VimbaPython_Source\vimba\c_binding\vimba_c.py in call_vimba_c(func_name, *args) 752 global _lib_instance--> 753 getattr(_lib_instance, func_name)(*args) 754 ~\VimbaPython_Source\vimba\c_binding\vimba_c.py in _eval_vmberror(result, func, *args) 670 if result not in (VmbError.Success, None):--> 671 raise VimbaCError(result) 672 VimbaCError: VimbaCError(<VmbError.ApiNotStarted: -2>)
The above exception was the direct cause of the following exception:
VimbaCameraError Traceback (most recent call last)C:\Users\JAMES~1.HAL\AppData\Local\Temp/ipykernel_10360/2024278461.py in
Hi,
From your description I see that you are using Python 3.6. VimbaPython requieres Python version 3.7 or higher
Best regards
Bernardo
Hi,
From your description I see that you are using Python 3.6. VimbaPython requieres Python version 3.7 or higher
Best regards
Bernardo
Sorry that was a typo, we are actually on python 3.9
i have this error too. If you found the cause please share.
Hi,
can you give an example of your code and/or check that the applicable commands are within the with Vimba.get_instance():
statement?
Cheers,
Teresa
Hey @wonwon0,
as mentioned by @Teresa-AlliedVision, please make sure to indent your code such that it is within the VmbSystem.get_instance()
with
-block. For whatever functionality (in this case, saving an image from the camera using VimbaX API), it should be written as given below:
from vmbpy import *
import cv2
with VmbSystem.get_instance() as vmb:
cams = vmb.get_all_cameras()
print("Cameras found: {}".format(len(cams)))
with cams[0] as cam:
frame = cam.get_frame()
frame.convert_pixel_format(PixelFormat.Mono8)
cv2.imwrite("frame.jpg", frame.as_opencv_image())
This example code can be found here.