pupil-labs / pyuvc

python binding to libuvc
Other
122 stars 51 forks source link

when i use uvc to get device_list, error happened, uvc has no attribute 'device_list' #103

Open justdomyself opened 1 week ago

justdomyself commented 1 week ago

I use windows system, pycharm。 python3.85.

`from rich import print from rich.logging import RichHandler import uvc

def main():

for device in uvc.device_list():

    cap = uvc.Capture(device["uid"])

    for mode in cap.available_modes:
        print(f"{cap.name} running at {mode}")
        try:
            cap.frame_mode = mode
        except uvc.InitError as err:
            print(f"{cap.name} mode selection - {err}")
            continue
        try:
            for x in range(10):
                frame = cap.get_frame_robust()
                print("frame gray mean", frame.gray.mean())
            # print(frame.img.mean())
        except uvc.InitError as err:
            print(f"{cap.name} getting frames - {err}")

    cap.close()`

error message below :

Traceback (most recent call last): File "F:\Python\python_libuvc\uvc.py", line 48, in main() File "F:\Python\python_libuvc\uvc.py", line 8, in main for device in uvc.device_list(): AttributeError: module 'uvc' has no attribute 'device_list'

justdomyself commented 2 days ago

any body have some suggestion ?