0

I converted my gui.py to gui.exe with py2exe, but it works only on windows 8 64 bit, when I tried it on win7 32 bit , it won't work

this code that converted .py to .exe

from distutils.core import setup
import py2exe

setup(console=['gui.py'])

any way to convert .py to .exe that works on all windows operating systems ...?

blaz1988
  • 63
  • 1
  • 1
  • 6
  • Dont u wonder why there are two different pakages of python versions for 64 bit and 32 bit windows? – Arvind Apr 02 '14 at 16:03

2 Answers2

2

You're building a 64-bit .exe, which won't work on 32-bit Windows. Install a 32-bit copy of Python and use that to make the package - it will be 32-bit then.

nobody
  • 19,814
  • 17
  • 56
  • 77
0

You can use something called pyinstaller. Install it using pip install PyInstaller. To use it follow these steps.

  1. In command line do pyinstaller your_file.py
  2. In file explorer go to your your folder where the python file was created. In that folder you will see a folder called dist. In that folder there will be a executable file which is your_file.exe or your_file without extension.

This works for both 64-bit and 32-bit!

Ayaan
  • 157
  • 1
  • 11