I compiled Qt from source in the Docker image that freezes the application 
and now it works launching it in Xenial.

No sure why though, it seems that now the "system search path" that LD 
tries to use before doing the fallback to LD_LIBRARY_PATH has changed from 
/usr/lib/x86_64-linux-gnu to /usr/lib, there is no libgobject-2.0.so.0 in 
the /usr/bin directory so it loads the frozen one and launches the 
application correctly.

Thanks!
On Friday, July 17, 2020 at 1:38:24 PM UTC+2 Miguel Rasero wrote:

> Hello everyone,
>
> I am using Pyinstaller to freeze a PyQt4 Python3 application, using a 
> onedir spec file.
>
> I did the freeze in ubuntu 12.04, when trying to run it in Ubuntu 16.04 I 
> get this error:
>
> ImportError: /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0: undefined 
> symbol: g_variant_dict_ref
>
> I have been debugging the problem using strace, this library is detected 
> and included by Pyinstaller but many libraries are being loaded directly 
> from system library paths instead of being loaded from the frozen directory.
>
> I did check os.environ from inside the frozen program and it is correct, 
> many libraries are loaded from the correct directory indeed, so I 
> used LD_DEBUG=all to get all dynamic library loading debug information.
>
> For most libraries it is correct, for ex:
>
>     10217:     file=libz.so.1 [0];  needed by ./manager [0]
>      10217:     find library=libz.so.1 [0]; searching
>      10217:      search path=/vagrant/bin/manager              
>  (LD_LIBRARY_PATH)
>      10217:       trying file=/vagrant/bin/manager/libz.so.1
>      10217:
>      10217:     file=libz.so.1 [0];  generating link map
>      10217:       dynamic: 0x00007fa77dfefdf0  base: 0x00007fa77ddda000  
>  size: 0x0000000000216230
>      10217:         entry: 0x00007fa77dddc050  phdr: 0x00007fa77ddda040  
> phnum:                  7
>
> But it seems that when the dynamic library it's loaded as a dependency 
> from any of the Qt libraries the system tries to load from system libraries 
> before trying to use LD_LIBRARY_PATH, for ex:
>
>    10217:     file=libgobject-2.0.so.0 [0];  needed by 
> /vagrant/bin/manager/libQtGui.so.4 [0]
>      10217:     find library=libgobject-2.0.so.0 [0]; searching
>      10217:      search path=           (RPATH from file 
> /vagrant/bin/manager/PyQt4/QtGui.so)
>      10217:      search path=/usr/lib/x86_64-linux-gnu          (system 
> search path)
>      10217:       trying file=/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
>      10217:
>      10217:     file=libgobject-2.0.so.0 [0];  generating link map
>      10217:       dynamic: 0x00007fa7750acb80  base: 0x00007fa774e5b000  
>  size: 0x0000000000252ee8
>      10217:         entry: 0x00007fa774e65f00  phdr: 0x00007fa774e5b040  
> phnum:                  7
>
> If I delete the file /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0, you 
> can see the difference:
>
>      10222:     file=libgobject-2.0.so.0 [0];  needed by 
> /vagrant/bin/manager/libQtGui.so.4 [0]
>      10222:     find library=libgobject-2.0.so.0 [0]; searching
>      10222:      search path=           (RPATH from file 
> /vagrant/bin/manager/PyQt4/QtGui.so)
>      10222:      search path=/usr/lib/x86_64-linux-gnu          (system 
> search path)
>      10222:       trying file=/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
>      10222:      search path=/vagrant/bin/manager              
>  (LD_LIBRARY_PATH)
>      10222:       trying file=/vagrant/bin/manager/libgobject-2.0.so.0
>      10222:
>      10222:     file=libgobject-2.0.so.0 [0];  generating link map
>      10222:       dynamic: 0x00007f15f4cecaa0  base: 0x00007f15f4a9f000  
>  size: 0x000000000024ef40
>      10222:         entry: 0x00007f15f4aaa0b0  phdr: 0x00007f15f4a9f040  
> phnum:                  7
>
> So if the dynamic system library is not compatible with the frozen one I 
> have problems running the program, that's the case for libgobject for 
> example.
>
> I am a bit lost here, does some know how to handle this?
>
> Thanks!
> Miguel
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/6eb956f4-155d-4cf6-b22c-1f40db3bc7a6n%40googlegroups.com.

Reply via email to