Converting a python 3.8 file to .exe

Geut picture Geut · Dec 2, 2019 · Viewed 12.4k times · Source

I've been trying to do so for a while. I followed a tutorial which said you should install pyinstaller first. So, I installed it. Then it said you should write pyinstaller --onefile -w file_name.py in cmd. I had an issue with that as well (there was an error). So, I installed another version of pyinstaller. I wrote the same thing, but no .exe file was created, only a new folder named "pycache" with a new .pyc file inside (I suppose it's a version of the file I wanted to turn into .exe). Then I tried installing cx freeze but pip won't install it.

I don't know what's the best way, maybe one of you have already tried doing this?

edit - here is what I wrote in cmd and what it said:

K:\>pyinstaller --onefile -w K:\geut_project\client_nuovo.py

74 INFO: PyInstaller: 4.0.dev0+9dd34bdfba

74 INFO: Python: 3.8.0

74 INFO: Platform: Windows-10-10.0.17134-SP0

250 INFO: wrote K:\client_nuovo.spec

252 INFO: UPX is not available.

261 INFO: Extending PYTHONPATH with paths

['K:\\geut_project', 'K:\\']

261 INFO: checking Analysis

312 INFO: checking PYZ

364 INFO: checking PKG

380 INFO: Building because K:\build\client_nuovo\client_nuovo.exe.manifest changed

380 INFO: Building PKG (CArchive) PKG-00.pkg

3881 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.

3897 INFO: Bootloader c:\users\user1\appdata\local\programs\python\python38\lib\site-packages\PyInstaller\bootloader\Windows-64bit\runw.exe

3898 INFO: checking EXE

3918 INFO: Rebuilding EXE-00.toc because pkg is more recent

3918 INFO: Building EXE from EXE-00.toc

3929 INFO: Appending archive to EXE K:\dist\client_nuovo.exe

6885 INFO: Building EXE from EXE-00.toc completed successfully.

K:\>

As I said I expected it to create an executable file but it didn't (as far as I know). It only created a folder named __ pycache__ and inside a file named client_nuovo.cpython-38.pyc (the original file's name is client_nuovo).

Answer

Uri Hoenig picture Uri Hoenig · Dec 2, 2019

According to this issue, PyInstaller doesn't support python 3.8 yet: https://github.com/pyinstaller/pyinstaller/issues/4311