How to import the package being frozen in the PyInstaller spec file?

I have this directory structure:

|___ installer.spec
|___ package/

and contains some variables I'd like to use in my installer.spec file. So this file contains a import package line. However, running pyinstaller installer.spec in mypackage/ fails with a ModuleNotFoundError.

How can I retrieve variables from the package I want to freeze while freezing it with PyInstaller?

Read more here:

Content Attribution

This content was originally published by Daniel Diniz at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: