lk-geimfari / mimesis

Mimesis is a robust data generator for Python that can produce a wide range of fake data in multiple languages.
https://mimesis.name
MIT License
4.39k stars 330 forks source link

I can't compile my project by pyinstaller #375

Closed dumprop closed 6 years ago

dumprop commented 6 years ago

I have a script with code:

from mimesis import Personal
person = Personal('en')
person.full_name()

and it works well, but after compiling this code to .exe via pyinstaller I have an error FileNotFoundError: [Errno 2] No such file or directory: 'B:\_MEI131682\mimesis\data/es\personal.json' [20624] Failed to execute script myproject So, I think that problem in path (data/es\\personal). What ways of solving this problem can you recommend?

lk-geimfari commented 6 years ago

@h0n3yc4k3 Seems like we have hardcoded path. It's a bug.

lk-geimfari commented 6 years ago

@h0n3yc4k3 I have fixed this issue (see #376). Now, this should work fine. Can you, please, uninstall an old version (v1.0.4) of mimesis and install latest (v1.0.5) and confirm that issue was fixed. Thanks!

dumprop commented 6 years ago

Yes, it fixed wrong path, but for unknown reasons pyinstaller doesnt import mimesis data :(

lk-geimfari commented 6 years ago

@h0n3yc4k3 Possible that the issue on the pyinstaller side. I really have not idea why this happens, sorry.

dumprop commented 6 years ago

But I compiled it 😄 I added mimesis data to working dir and executed pyinstaller --onefile --add-data mimesis;mimesis myscript.py and now all works fine :)

lk-geimfari commented 6 years ago

@h0n3yc4k3 My congratulations! That's awesome.