Pyzed.sl ImportError: DLL load failed: The specified module could not be found

Windows 10
pyzed 3.4
ZED SDK 3.4
Python 3.7.10

Any help would be appreciated

It looks like installation went OK:

python get_python_api.py
→ Downloading to ‘C:\Program Files (x86)\ZED SDK’
Detected platform:
win
Python 3.7
CUDA 11.1
ZED SDK 3.4 (requiring CUDA 11.1)
→ Checking if https://download.stereolabs.com/zedsdk/3.4/win/cu111/py37 exists and is available
→ Found ! Downloading python package into C:\Program Files (x86)\ZED SDK\pyzed-3.4-cp37-cp37m-win_amd64.whl
→ Installing necessary dependencies
Requirement already satisfied: numpy in c:\users\user\anaconda3\envs\zed1\lib\site-packages (1.20.2)
Processing c:\program files (x86)\zed sdk\pyzed-3.4-cp37-cp37m-win_amd64.whl
Installing collected packages: pyzed
Successfully installed pyzed-3.4
Done
Installing OpenGL dependencies required to run the samples
→ Downloading PyOpenGL-3.1.5-cp37-cp37m-win_amd64.whl
Processing c:\program files (x86)\zed sdk\pyopengl-3.1.5-cp37-cp37m-win_amd64.whl
Installing collected packages: PyOpenGL
Successfully installed PyOpenGL-3.1.5
→ Downloading PyOpenGL_accelerate-3.1.5-cp37-cp37m-win_amd64.whl
Processing c:\program files (x86)\zed sdk\pyopengl_accelerate-3.1.5-cp37-cp37m-win_amd64.whl
Installing collected packages: PyOpenGL-accelerate
Successfully installed PyOpenGL-accelerate-3.1.5
To install it later or on a different environment run :
python -m pip install --ignore-installed C:\Program Files (x86)\ZED SDK\pyzed-3.4-cp37-cp37m-win_amd64.whl

I’m in the same boat here!
If you roll back to python 3.6, it will work, but if you need at least Python 3.8 like me, it seems that we’re SOL!

Really, this should have been fixed in SDK 3.5.
I’m still searching for a workaround to get the dll file to load.

Alright, it seems I should have checked that that Github thread more closely.
I managed to get it to load and work properly!

Copy all the dll files from here: C:\Program Files (x86)\ZED SDK\bin
And paste them here: C:\Program Files\Python39\Lib\site-packages\pyzed (for python 3.9)

It loads and work fine with my application so far.

I my case it worked when I copied the dll files from ZED_SDK\bin to the folder where my Python script is.

BTW rolling back to python 3.6 did not do it for me, and also copying to C:\Users\User\anaconda3\Lib\site-packages\pyzed did not work.

1 Like

Hi,

Sorry to hear that you had trouble installing the Python API. There are indeed some issues for Windows users with Python versions greater than 3.8, but versions before that should work fine.
If ever you still have problems, you can also build the API from source. Here is the repository and the instructions to do so : zed-python-api

Hi Numitron

I’m encouraged to hear that you figured out the issue. I’m still trying to get there. Can you take a look at the screen shot and confirm whether or not your pyzed directory looked similar to mine. Unfortunately I am still getting the Dll load failed error

Did you have to use the SDK 3.4 in order for this workaround to work? I’m currently using
CUDA 11.0
ZED SDK 3.5
Python 3.9

And did you have to make any changes to your PYTHONPATH or the PATH environment variable in order to find the module?

Any help would certainly be appreciated!

Hi gpark.
Could you try putting the files in C:\Program Files\Python39\Lib\site-packages\pyzed instead of \AppData\Local\Programs\Python\Python39\Lib\site-packages\pyzed ?
My AppData site-packages does not contain the files.

I am using the same configuration as you. Did you install Python from the Windows store or from an installer?
I did not make any change to my environment variables to make it work.

Python 3.9, cuda11.1, zed sdk 3.5 works perfectly for me. Also try doing this in the virtual environment. In some cases you might have to manually copy all the dlls in the bin folder to the pyzed folder in site-packages.

2 Likes

To make it short, it means that you lacked some “dependencies” for the libraries you wanted to use. This is a common problem when installing python packages, mainly in windows. Before trying to use any kind of library, first it is suggested to look up whether it needs another library in python “family”.

The solution is to provide the python interpreter with the path-to-your-module/library. The simplest solution is to append that python path to your sys.path list. In your notebook, first try:

import sys
sys.path.append('my/path/to/module/folder')

This isn’t a permanent change in sys.path, because when you log out, your environment is reset, so any variables you may have set are lost.

The better (and more permanent) way to solve this is to set your PYTHONPATH, which provides the interpreter with additional directories look in for python packages/modules.

from BASH type: export PYTHONPATH=/path/to/new/folder:/another/path/...../ #each path must be separated by a colon

I think not the python path problem, i have try it but still not work.

Hi,

I recently purchased a ZED 2i and am experiencing issues. I have tried multiple versions of the ZED SDK along with different Python versions, including within a virtual environment. Additionally, I copied the DLL files from zed-sdk/bin to site-packages/pyzed.

Can someone please help me with a solution? I would greatly appreciate any assistance.

Thank you!