4.0.4 SDK Python Import Error

I built the 4.0.4 SDK using the same process we’ve used for all previous releases. However on importing the python library I get

> python
Python 3.9.17 (main, Jun  6 2023, 20:11:04) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyzed.sl as sl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: .../venv/lib/python3.9/site-packages/pyzed/sl.cpython-39-x86_64-linux-gnu.so: undefined symbol: _ZN2sl24SpatialMappingParametersC1ENS0_18MAPPING_RESOLUTIONENS0_13MAPPING_RANGEEibbbNS0_16SPATIAL_MAP_TYPEE

This occurs even after running python get_python_api.py

Hi,

You have a mismatch between the ZED SDK version and the python module version.
What is the output when you run get_python_api.py from your installation folder ?

Had already tried that

 python get_python_api.py
-> Downloading to '/usr/local/zed'
Detected platform:
	 linux_x86_64
	 Python 3.9
	 ZED SDK 4.0
-> Checking if https://download.stereolabs.com/zedsdk/4.0/whl/linux_x86_64/pyzed-4.0-cp39-cp39-linux_x86_64.whl exists and is available
-> Found ! Downloading python package into /usr/local/zed/pyzed-4.0-cp39-cp39-linux_x86_64.whl
-> Installing necessary dependencies
Requirement already satisfied: numpy in /home/.../venv/lib/python3.9/site-packages (1.23.0)
Processing ./pyzed-4.0-cp39-cp39-linux_x86_64.whl
Collecting numpy>=1.13 (from pyzed==4.0)
  Using cached numpy-1.25.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.7 MB)
Collecting cython>=0.28 (from pyzed==4.0)
  Using cached Cython-0.29.35-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (2.0 MB)
Installing collected packages: numpy, cython, pyzed
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
numba 0.56.4 requires numpy<1.24,>=1.18, but you have numpy 1.25.0 which is incompatible.
scipy 1.8.0 requires numpy<1.25.0,>=1.17.3, but you have numpy 1.25.0 which is incompatible.
Successfully installed cython-0.29.28 numpy-1.23.0 pyzed-4.0
Done
  To install it later or on a different environment run :
 python -m pip install --ignore-installed /usr/local/zed/pyzed-4.0-cp39-cp39-linux_x86_64.whl
() :/usr/local/zed []
> python
Python 3.9.17 (main, Jun  6 2023, 20:11:04)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyzed.sl as sl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /home/.../venv/lib/python3.9/site-packages/pyzed/sl.cpython-39-x86_64-linux-gnu.so: undefined symbol: _ZN2sl24SpatialMappingParametersC1ENS0_18MAPPING_RESOLUTIONENS0_13MAPPING_RANGEEibbbNS0_16SPATIAL_MAP_TYPEE

Can you try again ? We purged the CDN cache.

Same thing. Is there a way to see what version is getting installed?

> pip index versions pyzed
WARNING: pip index is currently an experimental command. It may be removed/changed in a future release without prior warning.
pyzed (1.3.0)
Available versions: 1.3.0, 0.0.0
  INSTALLED: 4.0
  LATEST:    1.3.0

It’s downloading this wheel
https://download.stereolabs.com/zedsdk/4.0/whl/linux_x86_64/pyzed-4.0-cp39-cp39-linux_x86_64.whl

There was indeed an issue with this specific version of Python (3.9). It’s fixed now.

Sorry for that !

Working now, thanks for always being so responsive!

1 Like