Creation of Windows executable file (*.exe) with PyDev-Eclipse and CDT-Eclipse --- How?

11,899

This is how I create .exe files from eclipse, in windows. Is not within the eclipse workbench but it might help you. To avoid problems, I would recommend to download everything for 32 bit even if you use 64 bit computer.

Install python 2.6

Install Eclipse

Install py2exe

In eclipse go to Help > Install new software and install pydev plugin from http://pydev.org/updates/

In windows preferences point the python interpreter to the location of your python.exe in your computer (C:/Python26)

you might need to add py2exe to the libraries

create a python module called setup.py with a code similar to this one:

from distutils.core import setup
import py2exe

setup(windows=['H:/yourworkspace/YourPythonProject/src/yourprogram.py'])

open windows console and type python H:/yourworkspace/YourPythonProject/src/setup.py py2exe

this will create a .exe located in C:/Python26/dist folder. It should work if you double click it but you cannot take it to a computer without python or any of the libraries that you´ve used. To do that, you can use Inno Setup.

It's very easy to use, basically it will ask for the location of the .exe, the dlls and folders that you want to add (I don't know about this so I add most of the things inside my C:/Python26/dist and it works). Inno setup will create an script and generate a .exe that you can install in any computer. You might need to edit the [Icons] part of the script, I had problems with that before to add an icon to the application.

That should hopefully work,

good luck.

Share:
11,899
Birdy40
Author by

Birdy40

Updated on June 15, 2022

Comments

  • Birdy40
    Birdy40 almost 2 years

    Is it possible to create Windows executable files for Python and C/C++ code within the Eclipse workbench? If yes, then how can this be done?