That setup should fail even without PyInstaller because mypkg.mymod is 
never imported.

# This initialises mypkg.__init__ only.
 import mypkg
if __name__ == "__main__":
    # So even if mymod has been collected by PyInstaller, it won't have been 
loaded
    # and set as an attribute of `mypkg`.
    mypkg.mymod.myfunc()

Possibly what your after is the following line in __init__.py?

from . import mymod

That way, initialising mypkg (using import mypkg) will implicitly load mymod 
and you can safely use mypkg.mymod.myfunc(). Alternatively you can just import 
mypkg.mymod.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/2ab888c0-279a-4ec2-bc86-65db45ff307bn%40googlegroups.com.

Reply via email to