amoeba commented on code in PR #45766: URL: https://github.com/apache/arrow/pull/45766#discussion_r1997061715
########## python/pyarrow/__init__.py: ########## @@ -412,14 +412,24 @@ def append_library_dir(library_dir): append_library_dir(library_dir[2:]) if _sys.platform == 'win32': + python_base_install = _os.path.dirname(_sys.executable) + # TODO(wesm): Is this necessary, or does setuptools within a conda # installation add Library\lib to the linker path for MSVC? - python_base_install = _os.path.dirname(_sys.executable) library_dir = _os.path.join(python_base_install, 'Library', 'lib') if _os.path.exists(_os.path.join(library_dir, 'arrow.lib')): append_library_dir(library_dir) + # GH-45530: Add pyarrow.libs dir containing delvewheel-mangled + # msvcp140.dll + pyarrow_libs_dir = _os.path.join( + python_base_install, "Lib", "site-packages", "pyarrow.libs" + ) Review Comment: Thanks! Delvewheel uses [a patch](https://github.com/adang1345/delvewheel/blob/c37a82f0f66dd73e0169ff637f7c0ba5b33032c6/delvewheel/_wheel_repair.py#L85-L108) similar to what @raulcd mentions. From our patched wheel, ``` # start delvewheel patch def _delvewheel_patch_1_10_0(): import os if os.path.isdir(libs_dir := os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, 'pyarrow.libs'))): os.add_dll_directory(libs_dir) ``` I'll try this out. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org