python-eel / Eel

A little Python library for making simple Electron-like HTML/JS GUI apps
MIT License
6.44k stars 587 forks source link

No module name error while building distributable file #399

Closed MK096 closed 4 years ago

MK096 commented 4 years ago

Whenever i use "cexprtk " package in python my program executes smoothly but whenever i try to build a distributable exe file it throws me a module not find error (in cmd) due to which the program doesn't execute cex

samuelhwilliams commented 4 years ago

This sounds like PyInstaller can't find cexprtk - please refer to their docs on how to include it: https://pyinstaller.readthedocs.io/en/stable/when-things-go-wrong.html#listing-hidden-imports

Please let us know if this solves your issue :) We mention this in our readme but maybe it's not clear enough.

MK096 commented 4 years ago

Also, when i try to build exe it throws an error "can't find the xyz.txt file". (This only happens when i try to build an exe ...When i compile my program in python IDLE this doesn't happen) form

samuelhwilliams commented 4 years ago

You'll need to look into PyInstaller to work out how to tell it that it needs to collect extra files your program expects to exist, e.g. formula.txt. From memory this would be something like adding the option --data-file formula.txt.

Edit: https://pyinstaller.readthedocs.io/en/stable/spec-files.html#adding-data-files, looks like it should be --add-data formula.txt