Python converting .py to .exe

Hello, I’m new to GitHub, I just recently made an account because of me doing a lot of projects for my class, and I’ve wanted to convert my files to an executable so that I can easily transfer them between people, I want to make some text games in python and I don’t wnat to have to have my friends install python and the IDE I’m using just so they can play/test my games/applications, the current issue I’ve come up with is with pyinstaller, I tried looking for solutions, but none of the forums I found were very useful. heres a paste of the error I get when I try to convert the file.

___ 

2481 INFO: PyInstaller: 3.4
2481 INFO: Python: 3.7.0
2481 INFO: Platform: Windows-10-10.0.17134-SP0
2535 INFO: wrote C:\Users\grove\Documents\Computer science\Python\Hyatt_Lyndon_madlibs.spec
2535 INFO: UPX is not available.
2566 INFO: Extending PYTHONPATH with paths
[‘C:\Users\grove\Documents\Computer science\Python’,
‘C:\Users\grove\Documents\Computer science\Python’]
2566 INFO: checking Analysis
2566 INFO: Building Analysis because Analysis-00.toc is non existent
2566 INFO: Initializing module dependency graph…
2613 INFO: Initializing module graph hooks…
2682 INFO: Analyzing base_library.zip …
21965 INFO: running Analysis Analysis-00.toc
22049 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by c:\users\grove\appdata\local\programs\python\python37-32\python.exe
22350 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\grove\appdata\local\programs\python\python37-32\python.exe
22387 WARNING: lib not found: api-ms-win-crt-locale-l1-1-0.dll dependency of c:\users\grove\appdata\local\programs\python\python37-32\python.exe
22466 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\grove\appdata\local\programs\python\python37-32\python.exe
22503 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\grove\appdata\local\programs\python\python37-32\python.exe
22550 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\users\grove\appdata\local\programs\python\python37-32\python.exe
22820 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\users\grove\appdata\local\programs\python\python37-32\python37.dll
22867 WARNING: lib not found: api-ms-win-crt-filesystem-l1-1-0.dll dependency of c:\users\grove\appdata\local\programs\python\python37-32\python37.dll
22889 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\grove\appdata\local\programs\python\python37-32\python37.dll
22936 WARNING: lib not found: api-ms-win-crt-time-l1-1-0.dll dependency of c:\users\grove\appdata\local\programs\python\python37-32\python37.dll
22967 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\grove\appdata\local\programs\python\python37-32\python37.dll
23005 WARNING: lib not found: api-ms-win-crt-conio-l1-1-0.dll dependency of c:\users\grove\appdata\local\programs\python\python37-32\python37.dll
23045 WARNING: lib not found: api-ms-win-crt-environment-l1-1-0.dll dependency of c:\users\grove\appdata\local\programs\python\python37-32\python37.dll
23081 WARNING: lib not found: api-ms-win-crt-locale-l1-1-0.dll dependency of c:\users\grove\appdata\local\programs\python\python37-32\python37.dll
23105 WARNING: lib not found: api-ms-win-crt-process-l1-1-0.dll dependency of c:\users\grove\appdata\local\programs\python\python37-32\python37.dll
23152 WARNING: lib not found: api-ms-win-crt-math-l1-1-0.dll dependency of c:\users\grove\appdata\local\programs\python\python37-32\python37.dll
23190 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\grove\appdata\local\programs\python\python37-32\python37.dll
23221 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\grove\appdata\local\programs\python\python37-32\python37.dll
23390 WARNING: lib not found: api-ms-win-crt-convert-l1-1-0.dll dependency of c:\users\grove\appdata\local\programs\python\python37-32\VCRUNTIME140.dll
23437 WARNING: lib not found: api-ms-win-crt-string-l1-1-0.dll dependency of c:\users\grove\appdata\local\programs\python\python37-32\VCRUNTIME140.dll
23468 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\grove\appdata\local\programs\python\python37-32\VCRUNTIME140.dll
23506 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\grove\appdata\local\programs\python\python37-32\VCRUNTIME140.dll
23553 WARNING: lib not found: api-ms-win-crt-heap-l1-1-0.dll dependency of c:\users\grove\appdata\local\programs\python\python37-32\VCRUNTIME140.dll
23591 INFO: Caching module hooks…
23684 INFO: Analyzing C:\Users\grove\Documents\Computer science\Python\Hyatt_Lyndon_madlibs.py
Traceback (most recent call last):
File “C:\Users\grove\AppData\Local\Programs\Python\Python37-32\Scripts\pyinstaller-script.py”, line 11, in <module>
load_entry_point(‘PyInstaller==3.4’, ‘console_scripts’, ‘pyinstaller’)()
File “c:\users\grove\appdata\local\programs\python\python37-32\lib\site-packages\PyInstaller__main__.py”, line 111, in run
run_build(pyi_config, spec_file, **vars(args))
File “c:\users\grove\appdata\local\programs\python\python37-32\lib\site-packages\PyInstaller__main__.py”, line 63, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File “c:\users\grove\appdata\local\programs\python\python37-32\lib\site-packages\PyInstaller\building\build_main.py”, line 838, in main
build(specfile, kw.get(‘distpath’), kw.get(‘workpath’), kw.get(‘clean_build’))
File “c:\users\grove\appdata\local\programs\python\python37-32\lib\site-packages\PyInstaller\building\build_main.py”, line 784, in build
exec(text, spec_namespace)
File “<string>”, line 17, in <module>
File “c:\users\grove\appdata\local\programs\python\python37-32\lib\site-packages\PyInstaller\building\build_main.py”, line 241, in __init__
self.__postinit__()
File “c:\users\grove\appdata\local\programs\python\python37-32\lib\site-packages\PyInstaller\building\datastruct.py”, line 158, in __postinit__
self.assemble()
File “c:\users\grove\appdata\local\programs\python\python37-32\lib\site-packages\PyInstaller\building\build_main.py”, line 443, in assemble
priority_scripts.append(self.graph.run_script(script))
File “c:\users\grove\appdata\local\programs\python\python37-32\lib\site-packages\PyInstaller\depend\analysis.py”, line 201, in run_script
self._top_script_node = super(PyiModuleGraph, self).run_script(pathname)
File “c:\users\grove\appdata\local\programs\python\python37-32\lib\site-packages\PyInstaller\lib\modulegraph\modulegraph.py”, line 1335, in run_script
contents = fp.read() + ‘\n’
File “c:\users\grove\appdata\local\programs\python\python37-32\lib\codecs.py”, line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0x92 in position 6222: invalid start byte

___

The solutions I’ve tried are; uninstalling visual C++ 2017 and re installing after installing C++ 2015, re installing python and my IDE, and even restarting my laptop. to which none seem to have fixed my issue.

My PC specs: Acer Aspire laptop

intel core I5 2nd generation

intel hd graphics 3000

600gb harddrive

Seems to be a problem with pyinstaller.

Try these answers:

https://www.dlology.com/blog/solution-pyinstaller-unicodedecodeerror-utf-8-codec-cant-decode-byte/

https://stackoverflow.com/questions/47692960/error-when-using-pyinstaller-unicodedecodeerror-utf-8-codec-cant-decode-byt

1 Like

What is Python\python37-32? I never saw that file name I don’t believe, is it 3.2 and 3.7? and does that actually work? I had some issues with multiple instalations recently, and just deleted all versions and redownloaded.

Also it looks like the Warnings come from lines trying to use the path containing it, so idk to me it seems like that could be it. Then again, i’m not sure, maybe thats a way to name the files and I just didn’t know about it.

>What is Python\python37-32?

It’s python 3.7, 32-bit [as compared to python 3.7, 64-bit].