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

PyInstaller works on the machine where python is installed not on users machine without python #5619

Closed
snehalnair opened this issue Mar 8, 2021 · 11 comments

Comments

@snehalnair
Copy link

snehalnair commented Mar 8, 2021

PyInstaller works on the machine where python is installed not on users machine.
Both the machines are 64bit Windows10.

  • On the user machine it doesnt give error, the command line shuts abruptly without showing error.
  • pyinstaller --debug=all --log-level=DEBUG --onedir ccg.py

User's Machine Command Line Messages: I have pasted below the last few lines of messages on command line before it shuts the window abruptly. I have attached the entire file incase you want to take a look at it.

import 'numpy.random._generator' # <_frozen_importlib_external.ExtensionFileLoader object at 0x000001B65B1FE8C8>
import 'numpy.random._pickle' # <pyimod03_importers.FrozenImporter object at 0x000001B6580E8348>
import 'numpy.random' # <pyimod03_importers.FrozenImporter object at 0x000001B6580E8348>
import numpy.ctypeslib # PyInstaller PYZ
import 'numpy.ctypeslib' # <pyimod03_importers.FrozenImporter object at 0x000001B6580E8348>
import numpy.ma # PyInstaller PYZ
import numpy.ma.core # PyInstaller PYZ
import 'numpy.ma.core' # <pyimod03_importers.FrozenImporter object at 0x000001B6580E8348>
import numpy.ma.extras # PyInstaller PYZ
import 'numpy.ma.extras' # <pyimod03_importers.FrozenImporter object at 0x000001B6580E8348>
import 'numpy.ma' # <pyimod03_importers.FrozenImporter object at 0x000001B6580E8348>
cli.txt

@snehalnair snehalnair changed the title PyInstaller works on the machine with python is installed not on users machine PyInstaller works on the machine where python is installed not on users machine without python Mar 8, 2021
@bwoodsend
Copy link
Member

Did you build it using Anaconda Python? It looks like NumPy/Conda's missing libiomp5.dll again...

@snehalnair
Copy link
Author

Thank you for a quick response!
Yes, I built it using Anaconda Python. How do I fix this error ?

@bwoodsend
Copy link
Member

It was fixed in #5168 so just install the development version:

conda remove pyinstaller
pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip

Then rebuild but add the --clean option.

@snehalnair
Copy link
Author

snehalnair commented Mar 9, 2021

Thank you!
Now I am getting a new error. I have also attached the logs displayed on console.

pyinstaller Failed to execute script pyi_rth__tkinter

I looked up on the internet and found this solution:

pyinstaller --onefile --add-binary='/System/Library/Frameworks/Tk.framework/Tk':'tk' --add-binary='/System/Library/Frameworks/Tcl.framework/Tcl':'tcl' PDT_Admin_Console.py

But the path seems to be invalid

pyinstaller: error: argument --add-binary: invalid add_data_or_binary value: '/System/Library/Frameworks/Tk.framework/Tk:tk'

I think this issue, 1957 tries to explain it, but I cant understand the final conclusion except to try running with --onefile instead of --onedir

___All_Errors.txt
CCG SCREENSHOT v4.txt

@rokm
Copy link
Member

rokm commented Mar 9, 2021

I looked up on the internet and found this solution:

pyinstaller --onefile --add-binary='/System/Library/Frameworks/Tk.framework/Tk':'tk' --add-binary='/System/Library/Frameworks/Tcl.framework/Tcl':'tcl' PDT_Admin_Console.py

That used to be a work-around for certain class of tkinter-related issues on macOS. It has been obsoleted on macOS in PyInstaller 4.x series, and is irrelevant to you anyway, as you're on Windows.

pyinstaller Failed to execute script pyi_rth__tkinter

Can you post the full error message (the preceding lines up until Traceback (most recent call last):)? It's probably missing either tcl or tk directory...

If you're not using Tcl/Tk via tkinter in your program, you can try excluding it via --exclude-module=tkinter --exclude-module=_tkinter; but you could also try to work around by simply creating empty tcl and tk directories in application's dist/ccg directory.

If you are using tkinter, then please attach full build log, so we can see why its data was not collected.

@snehalnair
Copy link
Author

snehalnair commented Mar 11, 2021

Thank you. Now I am getting a different error. I have attached logs details
"Failed to execute script pyiboot01_bootstrap'
logs.txt

@bwoodsend
Copy link
Member

bwoodsend commented Mar 11, 2021

I can't work out where PyInstaller puts os. I thought it lived in the base-library.zip but it doesn't. It must be baked directly into python.dll? No idea why it would get lost. Can you do a file list? dir /s /b I think on Windows. Or just find . if you have bash.

@snehalnair
Copy link
Author

I cant find it.

@rokm
Copy link
Member

rokm commented Mar 11, 2021

I can't work out where PyInstaller puts `os˙.

It should be in PYZ.

@rokm
Copy link
Member

rokm commented Mar 11, 2021

And I find it very odd that it wasn't collected; @snehalnair did you perhaps exclude it by accident?

@snehalnair
Copy link
Author

snehalnair commented Mar 12, 2021

I tested it on one user machine, I have everything working fine there now. Steps followed based on the suggestions given:
conda remove pyinstaller
pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip
pip install tkinter
rebuild using --clean command

Appreciate your help!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants