[issue46540] dylibs not loading properly from NFS mounts

embassy_vfx report at bugs.python.org
Wed Jan 26 16:05:40 EST 2022


New submission from embassy_vfx <emb_tech at theembassyvfx.com>:

MacOS Catalina 10.15.4 and 10.15.7
tested with XCode Python3.8 install and Python3.7.9 installer from https://www.python.org/ftp/python/3.7.9/python-3.7.9-macosx10.9.pkg (and my own build of 3.7.12)

When importing libraries that use shared object files to an NFS mounted directory, they do not open the dynamic library properly. We can use PySide2 as an example here. This workflow works fine in python 2.7 using the same steps.

Repro Steps:
1)pip install PySide2 to an NFS mounted directory: `/usr/local/bin/python3.7 -m pip install --target=/<path_to_nfs_dir>/nfs_3.7 PySide2`
2)`export PYTHONPATH=/<path_to_nfs_dir>/nfs_3.7`
3)run python `/usr/local/bin/python3.7`
4)import PySide2 - you should get an ImportError that looks like "dlopen(/<path_to_nfs_dir>/nfs_3.7/shiboken2/shiboken2.abi3.so, 2): Library not loaded: @rpath/libshiboken2.abi3.5.15.dylib" - otool shows shiboken2.abi3.so has it's rpath set as @loader_path and I've confirmed both files exist.

If I follow the same procedure above but instead install PySide2 to `/tmp/local_3.7` everything works as expected and the binaries are loaded properly.

I had this same issue with standard library .so files when I installed my custom build of python to an NFS mounted directory (_ssl as an example) but only when running through a virtual environment. Possibly @rath/@loader_path related? This seems to only be an issue on MacOS as I have no issues on the same NFS mount on Linux.

----------
components: macOS
messages: 411793
nosy: embassy_vfx, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: dylibs not loading properly from NFS mounts
type: behavior
versions: Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46540>
_______________________________________


More information about the Python-bugs-list mailing list