The “distribution was not found and is required by the application” means that you’re using pkg_resources.get_distribution("local_module_2")
somewhere? This should only work (PyInstaller or otherwise) if local module 2 is a fully fledged package. What do you mean by local module? Is it just a folder containing Python scripts or does it have a setup.py/setup.cfg or pyproject.toml?
pkg_resources.get_distribution("local_module_2")
'. The only way it is ever referenced is with "from localemodule 2 import thing 2'. I also tried changing that to 'import localmodule2' with no difference. The strange thing is that it is only this one file which is being mistaken. If I remove the line 'from local module 2 import thing 2' from my code then PyInstaller does successfully build the app. Of course the app does not run because it is missing local module 2 though, but this means it has successfully found all the other files localmodule3, localmodule4, etc, that it needed, and never accidentally mistook them for a distribution. Is there maybe some code inside local module 2 itself which makes PyInstaller believe it is more than just a .py file?
--
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 pyinstaller...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/54cd6e6c-4c67-4b08-98a2-5a76101af5a2n%40googlegroups.com.
Hmm, getting weird then. Can we have the full stacktrace/error message? I’d also double check for anything else with the same name as local_module_2:
python -c "from local_module_2 import __file__; print(__file__)"
Make sure that __file__
is what you expect it to be….