Loading user contributed Python-code plugins in a packed application

15 views
Skip to first unread message

eliben

unread,
Jun 29, 2009, 5:57:20 AM6/29/09
to PyInstaller
Hello,

I'm distributing a fairly complex PyQt based application as a
single .exe made by PyInstaller on Windows.

For some advanced users, I want to allow adding their own modules in a
special "plugins" directory. These modules can enhance the way the
application works in completely user-defined ways. However, there's a
slight problem with this approach:

My application has to expose an API to these plugin modules. I'm not
sure how the users should write the 'import' statements to make it
work. After all, all there is for a user is a big .exe, and his
module. Where will the module import the API code? Relatively?
How can this be made to work? How should the user's imports be
structured, or is there something special I have to tell PyInstaller
when creating the .exe?

Thanks in advance
Eli

Giovanni Bajo

unread,
Jun 30, 2009, 8:12:30 AM6/30/09
to PyIns...@googlegroups.com

You should do absolutely nothing, it should work out of the box.

PyInstaller first searches for imports within the big .exe, and then
look for them outside. If you bundle your API as a normal python package
within the big .exe, by simply importing it somewhere, it will
automatically be available for plugins.
--
Giovanni Bajo
Develer S.r.l.
http://www.develer.com

eliben

unread,
Jun 30, 2009, 10:54:42 AM6/30/09
to PyInstaller
> You should do absolutely nothing, it should work out of the box.
>
> PyInstaller first searches for imports within the big .exe, and then
> look for them outside. If you bundle your API as a normal python package
> within the big .exe, by simply importing it somewhere, it will
> automatically be available for plugins.
> --

Hello Giovanni, thanks for the reply - I'll see how it goes.
Eli
Reply all
Reply to author
Forward
0 new messages