I use pyinstaller or cx_Freeze whenever I want my Python file to convert it into a .exe package, but the problem is, my PC is 64-bit, and if I make that application, it only runs on a 64-bit PC, that's why I want to know, is there a way to develop 32-bit applications on a 64-bit PC using any module or anything? Please I really need an answer!
Asked
Active
Viewed 2,989 times
0
-
Similar to: https://stackoverflow.com/questions/7988772/create-32-bit-exes-from-python-code-on-64-bit-machine – 0 _ Jun 30 '21 at 12:04
2 Answers
3
Download, install a 32-bit version of python and use that instead of the 64 bit python that you are using.

stackoverblown
- 734
- 5
- 10
-
Yea, but I have a query, if I install both Pythons in my PC, how do I type the command in cmd/powershell, because, I think if I were to type the regular pyinstaller command, how would the PC know that I'm trying to use pyinstaller with 32 bit Python, do I need to head to the directory where Python 32-bit is installed and then write command?? – Vaibhav Kumar May 29 '20 at 11:29
-
@vaibhav You have a choice of a) using the full path to the 32bit python.exe, b) rename the 32bit python.exe to python32bit.exe and use that, c) in a cmd/powershell change directory to where 32 bit python.exe is and type .\python.exe ...etc. – stackoverblown May 29 '20 at 20:50
-
Yea, I tried the first option but it's too weird if I change it everytime, the third option is looking good, but I have to actually use pyinstaller command in the terminal (cmd/powershell), not Python, so how do PC understand I'm trying to access 32 bit Python pyinstaller?! I think, I got it, I need to go where pyinstaller is installed in 32 bit and work from there.. and that should make an executable for 32 bit, even if my path is set for 64 bit Python – Vaibhav Kumar May 30 '20 at 12:38
2
After installing both a 32 bit and 64 bit version of Python try running the following command to create the required exe distributable.
python -m pyinstaller {args}
Or it can be
python3.5 -m pyinstaller {args}
-
1
-
-
I'm not sure, but I think -m is used to run a script of python like pip, pyinstaller, etc. (normally found in "Python/Scripts") – Vaibhav Kumar Jun 30 '21 at 12:08
-
By the way, for using specific version of Python, we can use py -3.9 (for instance, you can type any version you have installed), I'm not sure if python3.5 would work because there might not be a direct executable or batch file called python3.5 by default. – Vaibhav Kumar Jun 30 '21 at 12:12