Repository navigation
macOS wheel fails to import - simdutf symbols not found at runtime #607
Description
Describe the bug
The library installs fine on Apple Silicon, but fails to on import:
Traceback (most recent call last):
File "<string>", line 1, in <module>
import mssql_python
File "/Users/personal/.cache/uv/archive-v0/c7DXyj30MtrFYthL/lib/python3.14/site-packages/mssql_python/__init__.py", line 14, in <module>
from .helpers import Settings, get_settings, _settings, _settings_lock
File "/Users/personal/.cache/uv/archive-v0/c7DXyj30MtrFYthL/lib/python3.14/site-packages/mssql_python/helpers.py", line 11, in <module>
from mssql_python import ddbc_bindings
File "/Users/personal/.cache/uv/archive-v0/c7DXyj30MtrFYthL/lib/python3.14/site-packages/mssql_python/ddbc_bindings.py", line 129, in <module>
module = importlib.util.module_from_spec(spec)
ImportError: dlopen(/Users/personal/.cache/uv/archive-v0/c7DXyj30MtrFYthL/lib/python3.14/site-packages/mssql_python/ddbc_bindings.cp314-universal2.so, 0x0002): symbol not found in flat namespace '__ZN7simdutf40convert_utf16le_to_utf8_with_replacementEPKDsmPc'To reproduce
Just import mssql_python fails:
uvx -p 3.14 --with mssql-python python -c 'import mssql_python'Expected behavior
No errors on import.
Further technical details
Python version: 3.14
SQL Server version: SQL Server 2022 (mcr.microsoft.com/mssql/server:2022-latest)
Operating system: macOS 26.5
Additional context
I believe the root cause is that mssql_python/pybind/CMakeLists.txt tries find_package(...) before falling back to FetchContent.
mssql-python/mssql_python/pybind/CMakeLists.txt
Lines 218 to 221 in f215ba7
| find_package(simdutf CONFIG QUIET) | |
| if(NOT simdutf_FOUND) | |
| include(FetchContent) |
Now, I think on the Azure Pipelines macOS-14 build runner, Homebrew has simdutf pre-installed, so find_package succeeds and links it as a dynamic library (/usr/local/opt/simdutf/lib/libsimdutf.34.dylib). That Homebrew path is baked into the x86_64 slice of the universal2 .so. I'm on Apple Silicon, so I think that suffers from a different problem, perhaps additionally that -undefined dynamic_lookup is passed to the linker:
| set_target_properties(ddbc_bindings PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") |
From the universal macOS .whl downloaded from PyPI:
otool -L dist/mssql_python-1.8.0-cp314-cp314-macosx_15_0_universal2/mssql_python/ddbc_bindings.cp314-universal2.so
mssql_python-1.8.0-cp314-cp314-macosx_15_0_universal2/mssql_python/ddbc_bindings.cp314-universal2.so (architecture x86_64):
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1345.120.2)
/usr/local/opt/simdutf/lib/libsimdutf.34.dylib (compatibility version 34.0.0, current version 34.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1700.255.5)
mssql_python-1.8.0-cp314-cp314-macosx_15_0_universal2/mssql_python/ddbc_bindings.cp314-universal2.so (architecture arm64):
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1345.120.2)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1700.255.5)and the simdutf symbol is undefined in both arch slices:
$ nm -u mssql_python-1.8.0-cp314-cp314-macosx_15_0_universal2/mssql_python/ddbc_bindings.cp314-universal2.so | rg simdutf
__ZN7simdutf40convert_utf16le_to_utf8_with_replacementEPKDsmPcI can confirm that
- find_package(simdutf CONFIG QUIET)
-
- if(NOT simdutf_FOUND)
- include(FetchContent)
- message(STATUS "simdutf not found via find_package; downloading v8.2.0 source archive with FetchContent")
- ...
- FetchContent_MakeAvailable(simdutf)
- endif()
+ include(FetchContent)
+ message(STATUS "Downloading simdutf v8.2.0 source archive with FetchContent")
+ ...
+ FetchContent_MakeAvailable(simdutf)does end up building a working wheel:
otool -L dist/mssql_python-1.8.0-cp314-cp314-macosx_15_0_universal2/mssql_python/ddbc_bindings.cp314-universal2.so
dist/mssql_python-1.8.0-cp314-cp314-macosx_15_0_universal2/mssql_python/ddbc_bindings.cp314-universal2.so (architecture x86_64):
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1356.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 2100.43.0)
dist/mssql_python-1.8.0-cp314-cp314-macosx_15_0_universal2/mssql_python/ddbc_bindings.cp314-universal2.so (architecture arm64):
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1356.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 2100.43.0)$ nm -u dist/mssql_python-1.8.0-cp314-cp314-macosx_15_0_universal2/mssql_python/ddbc_bindings.cp314-universal2.so | rg simdutf
<no output>
Activity
github-actions commentedon May 29, 2026
Hi Edgar Ramírez Mondragón (@edgarrmondragon), thank you for opening this issue!
Our team will review it shortly. We aim to triage all new issues within 24-48 hours and get back to you.
If you have additional information to share, please feel free to update the issue.
Thank you for your patience!
[-]macOS wheel fails to import — simdutf symbols not found at runtime[/-][+]macOS wheel fails to import - simdutf symbols not found at runtime[/+]bewithgaurav commentedon Jun 2, 2026
Edgar Ramírez Mondragón (@edgarrmondragon) thanks for highlighting this issue and raising the PR
we've triaged & this is a bug indeed and PR is a good fix on it and scoped nicely
I've kicked the CI on it & we will review it today in depth & get back on this
FIX: always statically link simdutf via FetchContent (#608)
FIX: always statically link simdutf via FetchContent (#608)
RELEASE:1.9.0 (#633)