473,326 Members | 2,136 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Creating a Exe of an Pyton Aplication in Windows and UNIX

440 256MB
Hi,
I want to create a Exe of an Pyton Aplication in Windows and UNIX.For example,Ihave the following ".py"files

Sample1.py
Sample2.py
Sample3.py
................
Samplen.py

Main.py

I would like to create an exe for the above files to support for Windows and UNIX OS.

Thanks
PSB
Mar 4 '07 #1
27 5299
ghostdog74
511 Expert 256MB
Hi,
I want to create a Exe of an Pyton Aplication in Windows and UNIX.For example,Ihave the following ".py"files

Sample1.py
Sample2.py
Sample3.py
................
Samplen.py

Main.py

I would like to create an exe for the above files to support for Windows and UNIX OS.

Thanks
PSB
what happens to googling? pyinstaller
Mar 4 '07 #2
bartonc
6,596 Expert 4TB
Hi,
I want to create a Exe of an Pyton Aplication in Windows and UNIX.For example,Ihave the following ".py"files

Sample1.py
Sample2.py
Sample3.py
................
Samplen.py

Main.py

I would like to create an exe for the above files to support for Windows and UNIX OS.

Thanks
PSB
I don't think this works on *nix. There are two articles on EXE creation in Python > Articles. Truelove911 has given basics of PyInstaller and py2exe.
Mar 4 '07 #3
ghostdog74
511 Expert 256MB
well, pyinstaller is supposed to work under windows, linux and irix, as stated in the project page. havn't tried though.
Mar 5 '07 #4
psbasha
440 256MB
Facing problem in creating a Py2Exe.

Step -1 ) My Python24 software is available at "C:\Python24".As suggested in the Article , I Copied the "pyinstaller-1.3" at the location "C:\Python24" after extracting the files.

Step-2 ) Double clicked on Configure.py, and config.dat is created

Step-3) download UPX from http://upx.sourceforge.net/#download (Win32 Console package)

Step-4) After unpacking the archive, copied upx.exe to C:\Python24 directory.

Step-5) Created "HelloWorld.py" at location "C:\Sample"

Step-6)Created HelloWorld.bat

Step-7) Double-click on HelloWorld.bat

After the Step -7 ,I am getting the following error message"'python' is not recognized as an internal or external command,
operable program or batch file."

-----------------------------------------------
Expand|Select|Wrap|Line Numbers
  1. Error
  2.  
  3. C:\Documents and Settings\xyz>C:\Sample\HelloWorld.bat
  4.  
  5. C:\Documents and Settings\xyz>set PIP=C:\Python24\pyinstaller-1.3\
  6.  
  7. C:\Documents and Settings\xyz>python C:\Python24\pyinstaller-1.3\Makespec.py
  8. --onefile --console --upx --tk HelloWorld.py
  9. 'python' is not recognized as an internal or external command,
  10. operable program or batch file.
  11.  
  12. C:\Documents and Settings\xyz>python C:\Python24\pyinstaller-1.3\Build.py Hel
  13. loWorld.spec
  14. 'python' is not recognized as an internal or external command,
  15. operable program or batch file.
  16.  
  17. C:\Documents and Settings\xyz>
  18.  
  19.  
Apr 21 '07 #5
bartonc
6,596 Expert 4TB
It's this last part
'python' is not recognized as an internal or external command,
operable program or batch file.
that causing the error.
To fix that you need to edit the PATH environment variable to include your python directory.
Apr 21 '07 #6
psbasha
440 256MB
It's this last partthat causing the error.
To fix that you need to edit the PATH environment variable to include your python directory.
The environment Variable Path is
Path

C:\Python25\;%SystemRoot%\system32;%SystemRoot%;%S ystemRoot%\System32\Wbem;

Could you please let me know whether I have to modify the above path for Python settings

-PSB
Apr 21 '07 #7
bartonc
6,596 Expert 4TB
The environment Variable Path is
Path

C:\Python25\;%SystemRoot%\system32;%SystemRoot%;%S ystemRoot%\System32\Wbem;

Could you please let me know whether I have to modify the above path for Python settings

-PSB
That look correct:
It could be an ActiveState thing. Is there a python.exe in C:\Python25\?
Apr 21 '07 #8
bartonc
6,596 Expert 4TB
That look correct:
It could be an ActiveState thing. Is there a python.exe in C:\Python25\?
Come to think of it, there are two such variables: one is system wide and one is for your log-in. If python.exe is in C:\Python25\, you'd better check the system PATH.
Apr 21 '07 #9
psbasha
440 256MB
That look correct:
It could be an ActiveState thing. Is there a python.exe in C:\Python25\?
Yes Python Exe is available in that path
C:\Python25\python25.exe
Apr 21 '07 #10
psbasha
440 256MB
Come to think of it, there are two such variables: one is system wide and one is for your log-in. If python.exe is in C:\Python25\, you'd better check the system PATH.

How to check the the system PATH?
Apr 21 '07 #11
psbasha
440 256MB
How to check the the system PATH?

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\xyz>path
PATH=C:\Python25\;C:\WINDOWS\system32;C:\WINDOWS;C :\WINDOWS\System32\Wbem;C:\Pro
gram Files\ATI Technologies\ATI Control Panel;
Apr 21 '07 #12
bartonc
6,596 Expert 4TB
How to check the the system PATH?
Right click My Computer: go to Properties|Advanced tab. Click Environment Variables.
Apr 21 '07 #13
psbasha
440 256MB
Right click My Computer: go to Properties|Advanced tab. Click Environment Variables.

The path above shown is the system variable.

Whether we have to remove the '\' at the end from the 'C:\Python25\'

-PSB
Apr 21 '07 #14
bartonc
6,596 Expert 4TB
The path above shown is the system variable.

Whether we have to remove the '\' at the end from the 'C:\Python25\'

-PSB
No, the "\" isn't the problem. Did you also check the PATH for "User variables for Your Login Name"?
Apr 22 '07 #15
psbasha
440 256MB
No, the "\" isn't the problem. Did you also check the PATH for "User variables for Your Login Name"?
Thanks Barton.

It is working fine after setting the Variable and Value in my LoginID variables.

I hope PyInstaller will not work for Python2.5 Version.In that case which software installation will help to create the "Exe"

-PSB
Apr 23 '07 #16
psbasha
440 256MB
When I build the Exe for the Application having dialog,Image and other .py files.The Python executable is created.But when I click that Exe the dialog is not invoked.

Even I am seeing the peculiar behavior,where I am not able to invoke even an simple dialog from "Pythonwin.exe".But the applications without dialogs are able to execute.

To get the Dialogs , I have to uninstall Python Software and re-install it to see ,the dialog based applications.

Thanks
PSB
Apr 24 '07 #17
psbasha
440 256MB
Hi,
I want to create a Exe of an Pyton Aplication in Windows and UNIX.For example,Ihave the following ".py"files

Sample1.py
Sample2.py
Sample3.py
................
Samplen.py

Main.py

I would like to create an exe for the above files to support for Windows and UNIX OS.

Thanks
PSB
Problem in building the Exe in Windows XP.
I have one main entry point from the UI ( Dlg.py ) and others are *.py files as mentioned above.

I am following the following steps to create exe for python files using Py2Exe Softwares.

I have followed the steps as suggested in the link

http://www.py2exe.org/index.cgi/Tutorial

I am able to create the Dlg.exe but not able to see the Dialog display when I execute the Dlg.Exe

Could anbody suggest me how to proceed with this

-PSB
May 8 '07 #18
psbasha
440 256MB
Problem in building the Exe in Windows XP.
I have one main entry point from the UI ( Dlg.py ) and others are *.py files as mentioned above.

I am following the following steps to create exe for python files using Py2Exe Softwares.

I have followed the steps as suggested in the link

http://www.py2exe.org/index.cgi/Tutorial

I am able to create the Dlg.exe but not able to see the Dialog display when I execute the Dlg.Exe

Could anbody suggest me how to proceed with this

-PSB
When we have Tix module,We are having problem in display of the User Interface Dialog.

Whether we have to follow different approach for to Build the Exe ,when we have Tix Module
May 8 '07 #19
psbasha
440 256MB
I have fixed the problem.

We have to set the Tix related DLL paths correctly in the Setup.py files.

-PSB
May 8 '07 #20
bartonc
6,596 Expert 4TB
I have fixed the problem.

We have to set the Tix related DLL paths correctly in the Setup.py files.

-PSB
Thank you SO much for the update! Would you mind posting some of the setup script?
May 8 '07 #21
psbasha
440 256MB
Thank you SO much for the update! Would you mind posting some of the setup script?
Expand|Select|Wrap|Line Numbers
  1. Setup.py
  2. import glob
  3. import os
  4. import sys
  5. from distutils.core import setup
  6. import py2exe
  7.  
  8. def files(folder):
  9.     for path in glob.glob(folder+'/*'):
  10.         if os.path.isfile(path):
  11.             yield path
  12.  
  13. data_files=[
  14.             ('.', glob.glob(sys.prefix+'/DLLs/*.dll')),
  15.             ('tcl/Tix8.4.2', files(sys.prefix+'/tcl/Tix8.4.2')), # Tix path
  16.             ('tcl/Tix8.4.2/bitmaps', files(sys.prefix+'/tcl/Tix8.4.2/bitmaps')),
  17.             ('tcl/Tix8.4.2/pref', files(sys.prefix+'/tcl/Tix8.4.2/pref')),
  18.            ]
  19.  
  20. setup(
  21.       script_args=['py2exe'],
  22.       windows=['C:\MainDialog.py'],
  23.       data_files=data_files,
  24.      )
  25.  
  26.  
  27.  
  28.  
May 9 '07 #22
psbasha
440 256MB
Expand|Select|Wrap|Line Numbers
  1. Setup.py
  2. import glob
  3. import os
  4. import sys
  5. from distutils.core import setup
  6. import py2exe
  7.  
  8. def files(folder):
  9.     for path in glob.glob(folder+'/*'):
  10.         if os.path.isfile(path):
  11.             yield path
  12.  
  13. data_files=[
  14.             ('.', glob.glob(sys.prefix+'/DLLs/*.dll')),
  15.             ('tcl/Tix8.4.2', files(sys.prefix+'/tcl/Tix8.4.2')), # Tix path
  16.             ('tcl/Tix8.4.2/bitmaps', files(sys.prefix+'/tcl/Tix8.4.2/bitmaps')),
  17.             ('tcl/Tix8.4.2/pref', files(sys.prefix+'/tcl/Tix8.4.2/pref')),
  18.            ]
  19.  
  20. setup(
  21.       script_args=['py2exe'],
  22.       windows=['C:\MainDialog.py'],
  23.       data_files=data_files,
  24.      )
  25.  
  26.  
  27.  
  28.  
You can refer to the link http://www.py2exe.org/index.cgi/TixSetup
May 9 '07 #23
psbasha
440 256MB
You can refer to the link http://www.py2exe.org/index.cgi/TixSetup
Any images files/help files has to be placed in the Exe build folder say
..\dist\

-PSB
May 9 '07 #24
psbasha
440 256MB
Has anybody used PyInstaller for building the Exe in UNIX OS ( AIX 5.3).If so ,can anbody help me in simnple steps,how we can build the Pyton application using the Pyinstaller.

a) Installation procedure for Pyinstaller.

b) Proceudre for building Python application in UNIX

c) Link for the Pyinstaller.

d) Any limitations in creating a Exe

-PSB
May 23 '07 #25
netz
1
Hi,

Probably this would help you.

http://logix4u.net/Python/Tutorials/...on_script.html

Thanks
Feb 26 '08 #26
raubana
56
There is this module called 'py2exe' that is mostly made for pygame apps, but i guess it would work with just python apps too!
Feb 28 '08 #27
jlm699
314 100+
There is this module called 'py2exe' that is mostly made for pygame apps, but i guess it would work with just python apps too!
I've used py2exe extensively and it works like a charm for cross-platform python executables
Feb 28 '08 #28

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Stephen VanDahm | last post by:
I'm looking for a way to install Python on a UNIX machine in a way such that any user on the system can use it, but only to execute scripts that are located in a certain directory. I do not have...
11
by: Mark de+la+Fuente | last post by:
I need to write simple scripts for executing command line functions. Up till now I've used C-Shell scripts for this, but I'm looking for a better alternative. And I keep reading about how “easy” it...
3
by: dpackwood | last post by:
Hello, I have two different scripts that do pretty much the same thing. The main perl script is on Windows. It runs and in the middle of it, it then calls out another perl script that then...
2
by: Matt | last post by:
I'm new to Java but experienced with PL/SQL. I've found what appears to be strange behaviour (a bug?) when attempting to create java stored objects using the UNIX version of Oracle SQL*PLUS...
7
by: Marek | last post by:
Whe i'm running my .net aplication from share on other server, i've got an error. Can someone explain what i must do? Unhandle exception:System.Security.SecurityException: Permission demand type...
5
by: fanor | last post by:
I have a windows aplication and i would like to send email. Does anyone one know what is the yahoo server??? TIA PD: my aplication is in VS 2005 and c#.
6
by: Pep | last post by:
Firstly, I'm not sure if this is the right group for this query, so please forgive me if I am wrong. My problem is that most users I distribute my software to cannot install it on their systems...
0
by: DKn | last post by:
Hello All, I am having an ACtiveX Control developed in C#.Net 2.0 windows Control Library. I have tested this control.TCS through ACtiveX Control Test Container. It is working fine, But the...
1
by: KF4fun | last post by:
Recently i am being given a windows aplication which was made using VB.net . I was asked to remake the windows aplication but i found it quite hard to do so because i am new to VB.net . The codes...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.