Get_python_api.py not working for me

I downloaded the latest SDK for Windows and I am trying to install the Python API in Anaconda. I already tried Python 3.10 and 3.11, run the prompt as admin but I am still getting same error.

(zed_env) c:\projects\src\zed>python get_python_api.py
→ Downloading to ‘c:\projects\src\zed’
Detected platform:
win_amd64
Python 3.10
ZED SDK 4.1
→ Checking if https://download.stereolabs.com/zedsdk/4.1/whl/win_amd64/pyzed-4.1-cp310-cp310-win_amd64.whl exists and is available
Traceback (most recent call last):
File “C:\Users\548863\AppData\Local\anaconda3\envs\zed_env\lib\site-packages\urllib3\connectionpool.py”, line 467, in _make_request
self._validate_conn(conn)
File “C:\Users\548863\AppData\Local\anaconda3\envs\zed_env\lib\site-packages\urllib3\connectionpool.py”, line 1099, in _validate_conn
conn.connect()
File “C:\Users\548863\AppData\Local\anaconda3\envs\zed_env\lib\site-packages\urllib3\connection.py”, line 653, in connect
sock_and_verified = _ssl_wrap_socket_and_match_hostname(
File “C:\Users\548863\AppData\Local\anaconda3\envs\zed_env\lib\site-packages\urllib3\connection.py”, line 806, in ssl_wrap_socket_and_match_hostname
ssl_sock = ssl_wrap_socket(
File "C:\Users\548863\AppData\Local\anaconda3\envs\zed_env\lib\site-packages\urllib3\util\ssl
.py", line 465, in ssl_wrap_socket
ssl_sock = ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname)
File "C:\Users\548863\AppData\Local\anaconda3\envs\zed_env\lib\site-packages\urllib3\util\ssl
.py", line 509, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File “C:\Users\548863\AppData\Local\anaconda3\envs\zed_env\lib\ssl.py”, line 513, in wrap_socket
return self.sslsocket_class._create(
File “C:\Users\548863\AppData\Local\anaconda3\envs\zed_env\lib\ssl.py”, line 1104, in _create
self.do_handshake()
File “C:\Users\548863\AppData\Local\anaconda3\envs\zed_env\lib\ssl.py”, line 1375, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\Users\548863\AppData\Local\anaconda3\envs\zed_env\lib\site-packages\urllib3\connectionpool.py”, line 793, in urlopen
response = self._make_request(
File “C:\Users\548863\AppData\Local\anaconda3\envs\zed_env\lib\site-packages\urllib3\connectionpool.py”, line 491, in _make_request
raise new_e
urllib3.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “C:\Users\548863\AppData\Local\anaconda3\envs\zed_env\lib\site-packages\requests\adapters.py”, line 486, in send
resp = conn.urlopen(
File “C:\Users\548863\AppData\Local\anaconda3\envs\zed_env\lib\site-packages\urllib3\connectionpool.py”, line 847, in urlopen
retries = retries.increment(
File “C:\Users\548863\AppData\Local\anaconda3\envs\zed_env\lib\site-packages\urllib3\util\retry.py”, line 515, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host=‘download.stereolabs.com’, port=443): Max retries exceeded with url: /zedsdk/4.1/whl/win_amd64/pyzed-4.1-cp310-cp310-win_amd64.whl (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)’)))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “c:\projects\offroad_light_bar\src\zed\get_python_api.py”, line 180, in
r = requests.get(whl_file_URL, allow_redirects=True)
File “C:\Users\548863\AppData\Local\anaconda3\envs\zed_env\lib\site-packages\requests\api.py”, line 73, in get
return request(“get”, url, params=params, **kwargs)
File “C:\Users\548863\AppData\Local\anaconda3\envs\zed_env\lib\site-packages\requests\api.py”, line 59, in request
return session.request(method=method, url=url, **kwargs)
File “C:\Users\548863\AppData\Local\anaconda3\envs\zed_env\lib\site-packages\requests\sessions.py”, line 589, in request
resp = self.send(prep, **send_kwargs)
File “C:\Users\548863\AppData\Local\anaconda3\envs\zed_env\lib\site-packages\requests\sessions.py”, line 703, in send
r = adapter.send(request, **kwargs)
File “C:\Users\548863\AppData\Local\anaconda3\envs\zed_env\lib\site-packages\requests\adapters.py”, line 517, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host=‘download.stereolabs.com’, port=443): Max retries exceeded with url: /zedsdk/4.1/whl/win_amd64/pyzed-4.1-cp310-cp310-win_amd64.whl (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)’)))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “c:\projects\src\zed\get_python_api.py”, line 184, in
except requests.exceptions.URLError as e:
AttributeError: module ‘requests.exceptions’ has no attribute ‘URLError’. Did you mean: ‘SSLError’?

(zed_env) c:\projects\offroad_light_bar\src\zed>pip install “C:\Users\548863\Downloads\pyzed-4.1-cp311-cp311-win_amd64 (1).whl”
ERROR: pyzed-4.1-cp311-cp311-win_amd64 (1).whl is not a valid wheel filename.

I downloaded the file manually and tried install it. It worked but then the python import does not work.

(zed_env) c:\projects\src\zed>pip install “pyzed-4.1-cp310-cp310-win_amd64.whl”
Processing pyzed-4.1-cp310-cp310-win_amd64.whl
Collecting numpy>=1.13 (from pyzed==4.1)
Downloading numpy-1.26.4-cp310-cp310-win_amd64.whl.metadata (61 kB)
---------------------------------------- 61.0/61.0 kB 1.1 MB/s eta 0:00:00
Collecting cython>=3.0.0 (from pyzed==4.1)
Downloading Cython-3.0.10-cp310-cp310-win_amd64.whl.metadata (3.2 kB)
Downloading Cython-3.0.10-cp310-cp310-win_amd64.whl (2.8 MB)
---------------------------------------- 2.8/2.8 MB 9.3 MB/s eta 0:00:00
Downloading numpy-1.26.4-cp310-cp310-win_amd64.whl (15.8 MB)
---------------------------------------- 15.8/15.8 MB 25.1 MB/s eta 0:00:00
Installing collected packages: numpy, cython, pyzed
Successfully installed cython-3.0.10 numpy-1.26.4 pyzed-4.1

(zed_env) c:\projects\src\zed>python
Python 3.10.14 | packaged by Anaconda, Inc. | (main, May 6 2024, 19:44:50) [MSC v.1916 64 bit (AMD64)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.

import pyzed.sl
Traceback (most recent call last):
File “”, line 1, in
ImportError: DLL load failed while importing sl: The specified module could not be found.

Hi @gmnvh,

Welcome to the Stereolabs forums :wave:

We will look into the SSL issue as this is not expected. Are you running the script with a particular network configuration such as a proxy or firewall?

For the installation of the ZED SDK, please follow the solution here, this should solve your issue: WIN10_PYTHON_API pyzed.sl, import Error: DLL load - #2 by alassagne

Hi Matthew, thanks very much for your reply.

The link you sent me fixed the DLL import issue. 😀

About the SSL issue, I am running the script in a company laptop but I don’t think it is a proxy or firewall issue because I used the same laptop to download the shl file using a browser. Unless browsers do the download in a different way. Not so familiar with that.

Anyway, Now I can start my ZED journey!! Thanks for everything.

Hi @gmnvh,

Great, glad to hear this solved the issue!

If you need anything else, feel free to open another ticket or send an email to support@stereolabs.com, we would be glad to help! :slight_smile: