Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib_programname not found by PyInstaller #9

Closed
2 tasks
maxfritzler opened this issue Nov 9, 2021 · 2 comments
Closed
2 tasks

lib_programname not found by PyInstaller #9

maxfritzler opened this issue Nov 9, 2021 · 2 comments
Assignees

Comments

@maxfritzler
Copy link

  • **I'm submitting a ... **

    • bug report
    • feature request
    • [ x] support request
  • Do you want to request a feature or report a bug?

  • What is the current behavior?
    In python script, use:
    import lib_programname
    logName = Path(lib_programname.get_path_executed_script()).stem + '.log'
    This works fine from the interpreter.

Now, use PyInstaller to build your application.
In the PyInstaller warn file I see:
missing module named lib_programname - imported by C:\Users\me\PycharmProjects\YouTube Utils\utterance_browser.py (top-level), myUtilities (top-level)

Unsuprisingly, if I run the resulting .exe I get:
ModuleNotFoundError: No module named 'lib_programname'
[21572] Failed to execute script 'comments_browser' due to unhandled exception!

My PyInstaller command line is:
pyinstaller myUtilties.py --clean --noconfirm --collect-data 'lib_programname'

I've also tried creating a .spec file and adding:
hiddenimports=['lib_programname'], which produces the same results as above.

  • **If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

  • What is the expected behavior?
    PyInstaller finds lib_programname and allows it to work with it's generated executable.

  • What is the motivation / use case for changing the behavior?
    You can use PyInstaller to generate multiple exes, one for as many separate scripts as you desire. Each of those exe's should log errors to a log file formed from their name. This works great with lib_programname running in the interpreter, just not in the exe's produced by Pyinstaller

  • Please tell us about your environment:

  • Release Number of the Repository used : lib_programname 1.1.8
  • Python Version : 3.9
  • OS, OS Version : Windows 10
  • Other information (e.g. detailed explanation, stack traces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow
    , gitter, etc)
@bitranox
Copy link
Owner

bitranox commented Nov 9, 2021

does not look like an error of lib_programname.
check these issues

and please let me know the result !

Especially I am curiouse if it can detect the programname when using PyInstaller ...

yours sincerely
bitranox

@bitranox bitranox self-assigned this Nov 9, 2021
@bitranox
Copy link
Owner

the packing is completely overhauled to PEP517 packing standard, so I guess this is solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants