Questions about updating to 5.0.3

(zed) C:\PhotonSport\app\bodytrack\body_track_v1.3.3>python body_tracking_cutout.py -cs main
Traceback (most recent call last):
File “C:\PhotonSport\app\bodytrack\body_track_v1.3.3\body_tracking_cutout.py”, line 18, in
import pyzed.sl as sl
File “pyzed\sl.pyx”, line 1, in init pyzed.sl
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

(zed) C:\body_track_v1.3.3>pip freeze
certifi==2025.7.9
charset-normalizer==3.4.2
colorama==0.4.6
coloredlogs==15.0.1
contourpy==1.3.2
cycler==0.12.1
Cython==3.1.2
dnspython==2.7.0
filelock==3.13.1
flatbuffers==25.2.10
fonttools==4.58.5
fsspec==2024.6.1
humanfriendly==10.0
idna==3.10
Jinja2==3.1.4
kiwisolver==1.4.8
lap==0.5.12
MarkupSafe==2.1.5
matplotlib==3.10.3
mpmath==1.3.0
networkx==3.3
numpy==2.2.6
nvidia-cuda-runtime-cu12==12.9.79
onnx==1.17.0
onnxruntime-gpu==1.22.0
onnxslim==0.1.59
opencv-python==4.12.0.88
packaging==25.0
paho-mqtt==2.1.0
pandas==2.3.1
pillow==11.0.0
protobuf==6.31.1
psutil==7.0.0
py-cpuinfo==9.0.0
pymongo==4.13.2
PyOpenGL @ file:///C:/Users/Administrator/PyOpenGL-3.1.6-cp311-cp311-win_amd64.whl#sha256=a7139bc3e15d656feae1f7e3ef68c799941ed43fadc78177a23db7e946c20738
PyOpenGL-accelerate @ file:///C:/Users/Administrator/PyOpenGL_accelerate-3.1.6-cp311-cp311-win_amd64.whl#sha256=56e36648ce3cb37341c5a74b3bb3aca831ce752c265819b9cb9263ee16cff0a2
pyparsing==3.2.3
pyreadline3==3.5.4
python-dateutil==2.9.0.post0
pytz==2025.2
PyYAML==6.0.2
pyzed @ file:///C:/Program%20Files%20%28x86%29/ZED%20SDK/pyzed-5.0-cp311-cp311-win_amd64.whl#sha256=19be711df428e44c4271b36bbaad52beb50bca749b52803e94497b6f3524b3e3
requests==2.32.4
scipy==1.16.0
six==1.17.0
sympy==1.13.3
tensorrt==10.12.0.36
tensorrt_cu12==10.12.0.36
tensorrt_cu12_bindings==10.12.0.36
tensorrt_cu12_libs==10.12.0.36
tensorrt_dispatch @ file:///C:/Users/Administrator/Downloads/TensorRT-10.12.0.36.Windows.win10.cuda-12.9/TensorRT-10.12.0.36/python/tensorrt_dispatch-10.12.0.36-cp311-none-win_amd64.whl#sha256=43e3d4c72f7348f7633ac665b67079eb91d5c407d1679f2fdaaf25ca67773d99
tensorrt_lean @ file:///C:/Users/Administrator/Downloads/TensorRT-10.12.0.36.Windows.win10.cuda-12.9/TensorRT-10.12.0.36/python/tensorrt_lean-10.12.0.36-cp311-none-win_amd64.whl#sha256=272066b8a2d50163de41942f2169b69a9918ef38d0f89141285a3f5c0f3a46d0
torch==2.7.1+cu128
torchaudio==2.7.1+cu128
torchvision==0.22.1+cu128
tqdm==4.67.1
typing_extensions==4.12.2
tzdata==2025.2
ultralytics==8.3.163
ultralytics-thop==2.0.14
urllib3==2.5.0

Hello @IASUI,

Thanks for the report!

The error

File > “C:\PhotonSport\app\bodytrack\body_track_v1.3.3\body_tracking_cutout.py”, line 18, in
import pyzed.sl as sl
File “pyzed\sl.pyx”, line 1, in init pyzed.sl
ValueError: numpy.dtype size changed, may indicate binary incompatibility. > Expected 96 from C header, got 88 from PyObject

means there is a mismatch between the numpy version that pyzed was compiled against and the numpy version currently installed in your environment. This usually happens after upgrading numpy or pyzed without rebuilding or reinstalling both together.

To fix this:

  • Could you try to uninstall both numpy and pyzed
pip uninstall numpy pyzed
  • Then to install first your required numpy version (e.g. for 2.2.6)
pip install numpy==2.2.6
  • Finally, you can reinstall pyzed (with the whl file or using the get_python_api script)
pip install path/to/your/pyzed/weel.whl

Note that:

  • For Python >3.8, pyzed expects numpy 2.x
  • If you use virtualenv/conda, always activate it before running pip
  • Make sure you are in the same Python environment for all commands (which python, which pip)

To verify your install:

You can simply run

python3 -c "import pyzed.sl as sl; print('Success! ZED Python API is working')"

This should get you back up and running! Let me know if you hit any other issues.


On another note, could you share the exact process you followed to get the error (e.g., which pyzed/numpy version you had before upgrading, whether you were using a clean environment or re-using an old one, which command you used to upgrade pyzed, and if you saw any warning/error messages, …)?
This can help us improve the docs, the installation process and prevent issues for others!

Traceback (most recent call last):
File “C:\Users\Administrator\Desktop\Apps\body_track\body_track\body_tracking_cutout.py”, line 18, in
import pyzed.sl as sl
File “pyzed\sl.pyx”, line 1, in init pyzed.sl
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

All environments are clean and newly installed. I need to install the following:

pip install requestspython "C:\Program Files (x86)\ZED SDK\get_python_api.py"pip install pymongopip install opencv-pythonpip3 install paho-mqttpip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126pip install ultralytics   pip install tensorrt

All Python versions have been tried but none work.

Hi @AnkerLeng,

Welcome to the StereoLabs community!


All environments are clean and newly installed. I need to install the following:

pip install requestspython "C:\Program Files (x86)\ZED SDK\get_python_api.py"pip install pymongopip install opencv-pythonpip3 install paho-mqttpip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126pip install ultralytics   pip install tensorrt

I’ve tried the setup you’ve described above with a freshly created conda environment on both a Linux and Windows machine and it worked fine in both cases:

conda create -n new_env python=3.12
conda activate new_env
python -m pip install requests
cd /usr/local/zed/ && python3 get_python_api.py # For Linux
python "C:\Program Files (x86)\ZED SDK\get_python_api.py" # For Windows
python -m pip install pymongo opencv-python paho-mqtt
python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126
python -m pip install ultralytics
python -m pip install tensorrt

I thought that may be one of your other packages might have other dependencies which would reinstall another version of numpy but it doesn’t look like it

I also recommend that after each step, especially after installing the ZED Python API, you check that everything is still working properly.
You can do this with:

python -c "import pyzed.sl as sl; print('Success! ZED Python API is working')"

Also, after each package installation, you might want to check your numpy version with:

python -c "import numpy; print(numpy.__version__)"

This ensures that none of the subsequent package installations downgrade or upgrade numpy in a way that could cause binary incompatibility.


Since you mentioned that

All Python versions have been tried but none work.

I’ve only double-checked Python 3.12 arbitrarily, but if you need to test with other versions, the above steps should still apply.


If you still encounter the error, could you please copy and paste the exact error message/output you see, and list all commands you ran, starting from when you created your environment.

This information will help us pinpoint exactly where things might be going wrong and provide a more accurate solution!

Let us know how it goes!