Trouble making my first python .exe using pyinstaller. - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Trouble making my first python .exe using pyinstaller. (/thread-1159.html) |
Trouble making my first python .exe using pyinstaller. - PickyBiker - Dec-08-2016 I am trying to make a win 10 executable (.exe) from my helloworld.py script. I have installed pyinstall-3.2 and following the install document isn't so easy. Any help getting this working will be appreciated. PyInstaller is located at: Quote:c:\pyInstaller-3.2 helloworld.py and hellowworld.bat are both at: Quote:c:\users\michael\desktop\helloworld\ Here is the Bat file python c:\pyInstaller-3.2\Makespec.py --onefile --console --upx --tk helloworld.py python c:\pyInstaller-3.2\PyInstaller\building\build_main.py helloworld.spec pauseHere is helloworld.py #!/usr/bin/env python for i in xrange(1000): print "Hello, World!"Finally, here are the error messages:
RE: Trouble making my first python .exe - Yoriz - Dec-08-2016 Simply install pyinstaller using pip Then open a command promt, change the directory to the location of the .py file Microsoft Windows [Version 10.0.14393] (c) 2016 Microsoft Corporation. All rights reserved. C:\WINDOWS\system32>cd /d c:\users\michael\desktop\helloworld\then execute pyinstaller using c:\users\michael\desktop\helloworld>pyinstaller --onefile --console --upx --tk helloworld.pyFor certain uses you may edit the contents of myscript.spec (described under Using Spec Files). After you do this, you name the spec file to PyInstaller instead of the script: c:\users\michael\desktop\helloworld>pyinstaller helloworld.spec RE: Trouble making my first python .exe - PickyBiker - Dec-08-2016 I got stuck on the second step. here is the activity and error c:\Users\Michael\Desktop\helloworld>dir Volume in drive C is OS Volume Serial Number is A2D2-EFB5 Directory of c:\Users\Michael\Desktop\helloworld 12/08/2016 05:06 PM <DIR> . 12/08/2016 05:06 PM <DIR> .. 12/08/2016 03:20 PM 169 helloworld.bat 12/08/2016 02:43 PM 76 helloworld.py 12/08/2016 05:06 PM 0 pyinstaller 3 File(s) 245 bytes 2 Dir(s) 709,115,584,512 bytes free c:\Users\Michael\Desktop\helloworld>pyinstaller --onefile --console --upx --tk helloworld.py usage: pyinstaller [-h] [-v] [-D] [-F] [--specpath DIR] [-n NAME] [-p DIR] [--hidden-import MODULENAME] [--additional-hooks-dir HOOKSPATH] [--runtime-hook RUNTIME_HOOKS] [--exclude-module EXCLUDES] [--key KEY] [-d] [-s] [--noupx] [-c] [-w] [-i <FILE.ico or FILE.exe,ID or FILE.icns>] [--version-file FILE] [-m <FILE or XML>] [-r RESOURCE] [--uac-admin] [--uac-uiaccess] [--win-private-assemblies] [--win-no-prefer-redirects] [--osx-bundle-identifier BUNDLE_IDENTIFIER] [--distpath DIR] [--workpath WORKPATH] [-y] [--upx-dir UPX_DIR] [-a] [--clean] [--log-level LEVEL] [--upx UPX] scriptname [scriptname ...]
RE: Trouble making my first python .exe - Yoriz - Dec-08-2016 Try executing with no options to begin with to see if it works like that c:\users\michael\desktop\helloworld>pyinstaller helloworld.pypyinstaller options --upx-dir UPX_DIR requires a path to UPX utility (default: search the execution path)is --tk a valid option I didn't spot it.
RE: Trouble making my first python .exe - PickyBiker - Dec-08-2016 Yes, that ran okay and the the exe file was found in the dist/helloworld folder and it ran so there must be something in the previous options that caused the error one more question, at the end oif the original command there was a --tk is tk supposed to be an executable somewhere? Anyway, thanks for the help RE: Trouble making my first python .exe using pyinstaller. - Yoriz - Dec-08-2016 Read the rest of my previous post RE: Trouble making my first python .exe using pyinstaller. - PickyBiker - Dec-09-2016 Oh yea, I see it now. --tk came from a "simple" install document that got me to this point. the path to UPX in set up on this system but removing --tk didn't help. I removed the --upx and --tk and it worked. Again, thanks for the help. RE: Trouble making my first python .exe using pyinstaller. - Larz60+ - Dec-09-2016 The manual is here, in case all else fails: https://pythonhosted.org/PyInstaller/ RE: Trouble making my first python .exe using pyinstaller. - PickyBiker - Dec-09-2016 Thanks Larz60+ |