OS Access violation error with python and OpenNI

Hello,

I am trying to get the feed of an Astra Orbbec Pro Plus camera through python using the following code.

import cv2
import numpy as np
from primesense import openni2
from primesense import _openni2 as c_api

openni2.initialize("C:/Program Files/OpenNI2/Redist")
dev = openni2.Device.open_any()
depth_stream = dev.create_depth_stream()
depth_stream.set_video_mode(c_api.OniVideoMode(pixelFormat = c_api.OniPixelFormat.ONI_PIXEL_FORMAT_DEPTH_100_UM, resolutionX = 640, resolutionY = 480, fps = 30))
depth_stream.start()

But it fails on initialization and specifically with this error
OSError: exception: access violation writing 0x000000000000000C

I have searched a lot but can’t figure out what is wrong with it. I have downloaded the driver and the OpenNI stuff and I also copied the necessary files from the Orbbec OpenNI SDK as another post suggested. Anyone have any ideas?

Using Windows 11 Pro btw.