I got this working using a hook for faker. The trick is to collect both
submodules and data files from faker.providers.
tree:
.
├── example.py
└── pyinstaller
├── hook-faker.py
example.py:
$ cat example.pyfrom faker import Faker
fake = Faker()
print fake.password(
length=3,
special_chars=False,
digits=True,
upper_case=False,
lower_case=True
)
print fake.domain_name()
pyinstaller/hook-faker.py:
from PyInstaller.utils.hooks import collect_submodules, collect_data_files
hiddenimports = collect_submodules('faker', 'providers')
datas = collect_data_files('faker.providers', include_py_files=True)
build command:
$ pyinstaller --clean --distpath dist --name example
--additional-hooks-dir pyinstaller/ example.py
run bundle:
$ ./dist/example/example
wwgkulas.com
On Wed, Feb 3, 2016 at 2:57 AM, nikola zagorski <[email protected]>
wrote:
> Well i've checked the link that you provided,but still i am facing the
> same issue. Maybe the problem is that the module loads dynamic random data
> when the app has been started. I've tried dynamic hooks, hiddenimports and
> everything possible,but still can't figure out why it can't find the
> module. In --onedir mode i can see the module is missing but that doesn't
> help me too much.
>
>
> Have a Nice Day
>
> Nikola
>
>
> --
> 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 post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/pyinstaller.
> For more options, visit https://groups.google.com/d/optout.
>
--
This e-mail, including attachments, contains confidential and/or
proprietary information, and may be used only by the person or entity to
which it is addressed. The reader is hereby notified that any
dissemination, distribution or copying of this e-mail is prohibited. If you
have received this e-mail in error, please notify the sender by replying to
this message and delete this e-mail immediately.
--
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.