Get_python_api python file gives me error when I run it

I have zed2 cam and I’m trying to make installation for zed sdk 4. I downloaded cuda 12, and then try to run the code to get pyzed module but it’s not working.

the errors that I got from code is:
Traceback (most recent call last):
File “c:\Program Files (x86)\ZED SDK\”, line 180, in
open(whl_file, ‘wb’).write(r.content)
PermissionError: [Errno 13] Permission denied: ‘c:\Program Files (x86)\ZED SDK\pyzed-4.0-cp39-cp39-win_amd64.whl’

and the other error is:
Traceback (most recent call last):
File “c:\Program Files (x86)\ZED SDK\”, line 183, in
except requests.exceptions.URLError as e:
AttributeError: module ‘requests.exceptions’ has no attribute ‘URLError’

Can you please help me to solve this?


It seems you are running the script from a folder that you are not allowed to write in. Can you try from somewhere else ? The scripts needs access to write the whl file before installing it.

1 Like

Thank you so much, it works now but the camera is not opening, I got CAMERA FAILED TO SETUP error now. Is it because of the pyzed module?

Here is the code for I use to open the cam

import as sl
import cv2

def main():
# Create a ZED camera object
zed = sl.Camera()
# Create a ZED camera object
# Set configuration parameters
init_params = sl.InitParameters()
init_params.camera_resolution = sl.RESOLUTION.HD1080
init_params.camera_fps = 30

# Open the ZED camera
err =
if err != sl.ERROR_CODE.SUCCESS:
    print(f"Kamera calismiyor {str(err)}")

# Set up the camera runtime parameters
runtime_params = sl.RuntimeParameters()

while True:
    # Capture a frame from the camera
    if zed.grab(runtime_params) == sl.ERROR_CODE.SUCCESS:
        # Retrieve the left image
        image = sl.Mat()
        zed.retrieve_image(image, sl.VIEW.VIEW_LEFT)

        # Convert the image to a format suitable for OpenCV
        frame = image.get_data()

        # Display the frame using OpenCV
        cv2.imshow("ZED Camera", frame)

        # Exit the loop when the 'q' key is pressed
        if cv2.waitKey(1) & 0xFF == ord('q'):

# Close the camera


At this point your python module looks to work as expected. It’s most probably something else. Can you send the diagnostic file outputed by ZED_Diagnostics ?

I guess I’m in trouble :')

ZED_Diagnostic_Results.json (10.9 KB)

Are you using a USB3 port ?

yes, I’m using USB 3 port

The diag suggest otherwise. Are you using a hub ? Can you change usb port, or reboot ?