Mimino666 / langdetect

Port of Google's language-detection library to Python.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add support for PyInstaller

martingull opened this issue · comments

Define MESSAGE_FILENAME in the following way to support exe file creation. Add to messages.py

class Messages(object):

if getattr(sys, 'frozen', False):
    # If the application is run as a bundle, the pyInstaller bootloader
    # extends the sys module by a flag frozen=True and sets the app path into variable _MEIPASS'.
    MESSAGES_FILENAME = path.join(sys._MEIPASS, 'messages.properties')
else:
    MESSAGES_FILENAME = path.join(path.dirname(__file__), 'messages.properties')

This seems to be part of the problem. However, pyInstaller ignores the binaries, so those needs to be added manually

I've got the same problem. Do you solved it somehow? @martingull