Home My Page Projects Code Snippets Project Openings devtools
Summary Activity Tracker SCM

[#2301] linux linux-rpath.sh, some values not set - shiboken2 import failure

Date:
2020-07-09 18:11
Priority:
3
State:
Open
Submitted by:
Charles Ballard (ccb63)
Assigned to:
Nobody (None)
branch:
py3
type:
none
Summary:
linux linux-rpath.sh, some values not set - shiboken2 import failure

Detailed description
Python 3.7.1 (default, Jul 8 2020, 09:32:50)
[GCC 5.3.1 20160406 (Red Hat 5.3.1-6)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import PySide2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ccp4/ccp4-20200708/lib/python3.7/site-packages/PySide2/__init__.py", line 51, in <module>
_setupQtDirectories()
File "/home/ccp4/ccp4-20200708/lib/python3.7/site-packages/PySide2/__init__.py", line 21, in _setupQtDirectories
import shiboken2
File "/home/ccp4/ccp4-20200708/lib/python3.7/site-packages/shiboken2/__init__.py", line 27, in <module>
from .shiboken2 import *
ImportError: libshiboken2.cpython-37m-x86_64-linux-gnu.so.5.12: cannot open shared object file: No such file or directory
>>> import shiboken2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ccp4/ccp4-20200708/lib/python3.7/site-packages/shiboken2/__init__.py", line 27, in <module>
from .shiboken2 import *
ImportError: libshiboken2.cpython-37m-x86_64-linux-gnu.so.5.12: cannot open shared object file: No such file or directory
>>>


ldd lib/python3.7/site-packages/shiboken2/shiboken2.cpython-37m-x86_64-linux-gnu.so
linux-vdso.so.1 => (0x00007ffe1a9fa000)
libshiboken2.cpython-37m-x86_64-linux-gnu.so.5.12 => not found
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f5a6b45b000)
libm.so.6 => /lib64/libm.so.6 (0x00007f5a6b159000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f5a6af43000)
libc.so.6 => /lib64/libc.so.6 (0x00007f5a6ab75000)
/lib64/ld-linux-x86-64.so.2 (0x00007f5a6b969000)
Message  ↓
Date: 2020-07-10 16:19
Sender: Charles Ballard

Update linux-rpath.sh for the shiboken and pyside2 directories with extend path

=== modified file 'misc/linux-rpath.sh'
--- misc/linux-rpath.sh 2014-11-26 16:47:05 +0000
+++ misc/linux-rpath.sh 2020-07-10 16:18:46 +0000
@@ -18,3 +18,30 @@
patchelf --force-rpath --set-rpath "$should_be" "$b"
fi
done
+
+if [ -e "lib/python3.7/site-packages/PySide2" ] ; then
+for b in $(find lib/python3.7/site-packages/PySide2 -name \*.so*); do
+ [ -h $b ] && continue # skip symlinks, to make it faster
+ rpath="$(patchelf --print-rpath $b 2>/dev/null)" ||:
+ [ -z "$rpath" ] && continue
+ should_be='$ORIGIN/'"$(dirname $b | sed --regexp-extended 's=[^/]+=..=g')"/lib':$ORIGIN/.:$ORIGIN/../shiboken2'
+ if [ "$rpath" != "$should_be" ]; then
+ [ $VERBOSE != 0 ] && echo "$b $rpath -> $should_be"
+ #chmod u+w $b
+ patchelf --force-rpath --set-rpath "$should_be" "$b"
+ fi
+done
+fi
+if [ -e "lib/python3.7/site-packages/shiboken2" ] ; then
+for b in $(find lib/python3.7/site-packages/shiboken2 -name \*.so*); do
+ [ -h $b ] && continue # skip symlinks, to make it faster
+ rpath="$(patchelf --print-rpath $b 2>/dev/null)" ||:
+ [ -z "$rpath" ] && continue
+ should_be='$ORIGIN/'"$(dirname $b | sed --regexp-extended 's=[^/]+=..=g')"/lib':$ORIGIN/.'
+ if [ "$rpath" != "$should_be" ]; then
+ [ $VERBOSE != 0 ] && echo "$b $rpath -> $should_be"
+ #chmod u+w $b
+ patchelf --force-rpath --set-rpath "$should_be" "$b"
+ fi
+done
+fi

No Changes Have Been Made to This Item