How to use 64MP autofocus arducam with python?

I am trying to write a python code to control Arducam 64MP autofocus on Pi zero (Bullseye OS). After I install the driver in the manual documentation, I found that picamera2 is deleted and only picamera library, So I used this code to see if the camera works:

from picamera import PiCamera
import time

camera = PiCamera()

An error occurs with PiCamera and it tell to enable camera with sudo raspi-config.
But after enable, my camera doesn’t work any more, even when using licamera-still to check.
What is the proper way to use this 64 MP autofocus camera with python then?
Thank you

First, you need to make the camera work with libcamera-still. Does the pi 0 work when you reboot it?
If not, you can re-burn the OS and install everything again.
Once you manage to access the camera with libcamera command, you can refer to the link below to use picamera2.


import time

from picamera2 import Picamera2, Preview

picam2 = Picamera2()

preview_config = picam2.create_preview_configuration()


picam2.set_controls({"AfMode": 1 ,"AfTrigger": 0})
# If your libcamera-dev version is 0.0.10, use the following code.
# AfMode Set the AF mode (manual, auto, continuous)
# For example, single focus: picam2.set_controls({"AfMode": 1 ,"AfTrigger": 0})
#              continuous focus: picam2.set_controls({"AfMode": 2 ,"AfTrigger": 0})