You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ cd dist-patched/
dist-patched$ unzip PyMyLib-0.1.17-cp39-cp39-macosx_12_0_arm64.whl
dist-patched$ otool -L PyMyLib-0.1.17.data/purelib/PyMyLib/PyMyLib.cpython-39-darwin.so
PyMyLib-0.1.17.data/purelib/PyMyLib/PyMyLib.cpython-39-darwin.so:
@loader_path/../../../PyMyLib.dylibs/libboost_date_time-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
@loader_path/../../../PyMyLib.dylibs/libboost_iostreams-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
@loader_path/../../../PyMyLib.dylibs/libboost_random-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
@loader_path/../../../PyMyLib.dylibs/libboost_serialization-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
@loader_path/../../../PyMyLib.dylibs/libboost_system-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
@loader_path/../../../PyMyLib.dylibs/libboost_unit_test_framework-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
@loader_path/../../../PyMyLib.dylibs/libboost_log-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
@loader_path/../../../PyMyLib.dylibs/libicudata.70.1.dylib (compatibility version 70.0.0, current version 70.1.0)
@loader_path/../../../PyMyLib.dylibs/libicui18n.70.1.dylib (compatibility version 70.0.0, current version 70.1.0)
@loader_path/../../../PyMyLib.dylibs/libicuuc.70.1.dylib (compatibility version 70.0.0, current version 70.1.0)
@loader_path/../../../PyMyLib.dylibs/libpcre.1.dylib (compatibility version 4.0.0, current version 4.13.0)
@loader_path/../../../PyMyLib.dylibs/libboost_chrono-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
@loader_path/../../../PyMyLib.dylibs/libboost_regex-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
@loader_path/../../../PyMyLib.dylibs/libboost_filesystem-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
@loader_path/../../../PyMyLib.dylibs/libboost_thread-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
@loader_path/../../../PyMyLib.dylibs/libboost_atomic-mt.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1200.3.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.0.0)
Note all the relative paths @loader_path/../../../PyMyLib.dylibs. While these match the files as they are placed inside the wheel archive, after pip install these relative paths don't point to the dylibs under site-packages:
Note how PyMyLib.cpython-39-darwin.so and __init__.py have been installed directly to PyMyLib/, not to PyMyLib-0.1.17.data/purelib/PyMyLib/ (as it looks in the wheel archive).
Consequently, I get import errors because the dynamic libraries are not found:
$ python -c 'import PyMyLib'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "...../.venv-devel-macos-arm64-tf26/lib/python3.9/site-packages/PyMyLib/__init__.py", line 1, in <module>
from .PyMyLib import PyMyLib as MyLib
ImportError: dlopen(...../.venv-devel-macos-arm64-tf26/lib/python3.9/site-packages/PyMyLib/PyMyLib.cpython-39-darwin.so, 0x0002): Library not loaded: @loader_path/../../../PyMyLib.dylibs/libboost_date_time-mt.dylib
Referenced from: ...../.venv-devel-macos-arm64-tf26/lib/python3.9/site-packages/PyMyLib/PyMyLib.cpython-39-darwin.so
Reason: tried: '...../.venv-devel-macos-arm64-tf26/lib/python3.9/site-packages/PyMyLib/../../../PyMyLib.dylibs/libboost_date_time-mt.dylib' (no such file), '/usr/local/lib/libboost_date_time-mt.dylib' (no such file), '/usr/lib/libboost_date_time-mt.dylib' (no such file)
Expected behavior delocate-wheel should set relative paths to dylibs in such a way that they agree with their ultimate location after pip install.
Wheels used
Unfortunately not open source. But the __init__.py contains just these lines:
from .PyMyLibimportPyMyLibasMyLibif__name__=="__main__":
pass
Platform (please complete the following information):
OS version: macOS 12.2.1 (Apple Silicon)
Delocate version: 0.10.2
$ pip --version
pip 22.0.4 from ...../.venv-devel-macos-arm64-tf26/lib/python3.9/site-packages/pip (python 3.9)
Additional context
I actually don't know why our (cmake-based) build process produces wheels with these subdirectories PyMyLib-0.1.17.data/purelib. Pointers that could help me simplify that would also be appreciated. 🙂
The text was updated successfully, but these errors were encountered:
I know this bug report is a bit old but came across this today whilst packaging an existing CMake project into a wheel. It hapens because delocate doesn't take account of the final locations of files installed into the "data" folder in the wheel, as these go directly into the root of the environment.
Describe the bug / To Reproduce
My original wheel contains these files:
It depends on Boost, ICU, and PCRE, which have been installed via Homebrew:
I call
delocate-wheel
like this:The dylibs are properly copied into the delocated wheel:
The output of
delocate-listdeps
looks reasonable at first sight:However,
otool -L
shows me these relative paths:Note all the relative paths
@loader_path/../../../PyMyLib.dylibs
. While these match the files as they are placed inside the wheel archive, afterpip install
these relative paths don't point to the dylibs under site-packages:Note how
PyMyLib.cpython-39-darwin.so
and__init__.py
have been installed directly toPyMyLib/
, not toPyMyLib-0.1.17.data/purelib/PyMyLib/
(as it looks in the wheel archive).Consequently, I get import errors because the dynamic libraries are not found:
Expected behavior
delocate-wheel
should set relative paths to dylibs in such a way that they agree with their ultimate location afterpip install
.Wheels used
Unfortunately not open source. But the
__init__.py
contains just these lines:Platform (please complete the following information):
Additional context
I actually don't know why our (cmake-based) build process produces wheels with these subdirectories
PyMyLib-0.1.17.data/purelib
. Pointers that could help me simplify that would also be appreciated. 🙂The text was updated successfully, but these errors were encountered: