(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
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:
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:
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:
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
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!
We will resolve this in an upcoming patch. Please keep an eye on the release notes to see if the fix is included in the next release; if not, it will be addressed in the following one.
→ Can you still confirm that pyzed works properly, using python -c "import pyzed.sl as sl; print('Success! ZED Python API is working')"?
2. Binary incompatibility with numpy for Python 3.11 on Windows
I have reproduced this issue on Windows with Python 3.11. Note: The problem does not occur on Windows with Python 3.12, or on Linux with Python 3.11.
At the moment, I don’t have an immediate workaround for Python 3.11. Apologies for that! Temporary fix: Please upgrade to Python 3.12.
I will investigate further what’s happening on this specific version on Windows an keep you posted
Let me know if you have further questions or updates!
FYI, the issue has been identified and confirmed to only happen on Windows platform and with python version 3.9, 3.10 and 3.11. Other python version and other platforms appear fine in our tests. A temporary workaround remain to upgrade to Python 3.12 if possible.
All issues mentioned in this thread are expected to be fixed in the next patch.
Feel free to reach out if you encounter any related issues or have further questions!