Using shared libraries

661 views
Skip to first unread message

Bertrand Servin

unread,
Sep 8, 2010, 9:59:21 AM9/8/10
to pyins...@googlegroups.com
Hi,

I am new to pyinstaller and run into a rather odd problem,
I wonder if anyone could help me. I am using pyinstaller
on a linux machine for my tests.

I am using the python module yapgvb, which stands
for Yet Another Python GraphViz Binding. As per its
name it binds the graphviz library that can be called within
python. As far as I understand, this library comes
with modules located under /usr/lib/graphviz/ where
a config file specifies the plugins available on the system
(in the form of shared libraries libgvplugin_FOO.so.5).

I can build the executable with pyinstaller but it will fail
to find those plugins when ran on the same system it was built on.

I tried to use the COLLECT method to include all the plugins
but it doesn't seem to work.

I include an example code that demonstrates the issue.
Running the python script as usual works ok. When
built using pyinstaller I get a graphviz error:

Error: Layout type: "dot" not recognized. Use one of:
Layout was not done

Do you have any clues on how I could solve the problem ?

thanks for your help,
--
Bertrand

PYIyapgvb.py

Martin Zibricky

unread,
Sep 8, 2010, 5:09:25 PM9/8/10
to pyins...@googlegroups.com
Bertrand Servin píše v St 08. 09. 2010 v 15:59 +0200:

> Do you have any clues on how I could solve the problem ?

Maybe it could solve to write some import hooks for package 'yapgvb'.

Please look in manual for 'hook', 'hidden import':
http://www.pyinstaller.org/export/latest/tags/1.4/doc/Manual.html

and in the pyinstaller source see folder: 'hooks'

Bertrand Servin

unread,
Sep 10, 2010, 10:40:00 AM9/10/10
to pyins...@googlegroups.com

Thanks, indeed, there seems to be some similar stuff in there
(like in the hoot-PyQT4... files). I'll try it this way.

--
B

Bertrand Servin

unread,
Sep 16, 2010, 3:14:25 AM9/16/10
to pyins...@googlegroups.com

So I tried it this way, but with no luck. This is not a problem
with pyInstaller, as I was able to include the shared
libraries with a hook-yapgvb, but a problem with graphviz itself.
Its mechanism for finding plugins is odd and I don't think it allows
inclusion of the .so files within a standalone binary.

thanks again for the help
--
Bertrand

Martin Zibricky

unread,
Sep 16, 2010, 4:25:10 AM9/16/10
to pyins...@googlegroups.com
Bertrand Servin píše v Čt 16. 09. 2010 v 09:14 +0200:

> thanks again for the help

you're welcome

Nathan Salomonis

unread,
Dec 12, 2012, 3:36:46 AM12/12/12
to pyins...@googlegroups.com, mzib...@gmail.com
I am actually having a similar issue where I am building an python app on a Mac (current dev version of pyinstaller) that depends on pygraphviz and graphviz. Same issue as above with pygraphviz not finding the dot method. This occurs when I build with the option:

python pyinstaller.py [path] -w

But works just fine (runs graphviz) with:

python pyinstaller.py [path] -onefile

The main difference is that the first produces a Mac .app executable and the second produces a Unix Executable file. The reason I want to go with the first is that you can exclude the console window and have a custom .icns file (replace the default used in the pyinstaller/bootloader/images folder) which will show your program icon versus the feather icon. I know these issues are largely cosmetic but they definitely impact the user's ability to use the program.

Thanks a lot!

Nathan

Reply all
Reply to author
Forward
0 new messages