How to use 64MP autofocus arducam with python?

Hi,
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()
camera.start_preview()
time.sleep(10)
camera.stop_preview()

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

Hi,
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.
https://docs.arducam.com/Raspberry-Pi-Camera/Native-camera/PiCamera2-User-Guide/

#!/usr/bin/python3

import time

from picamera2 import Picamera2, Preview

picam2 = Picamera2()
picam2.start_preview(Preview.QTGL)

preview_config = picam2.create_preview_configuration()
picam2.configure(preview_config)

picam2.start()
time.sleep(1)

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})

time.sleep(5)