473,326 Members | 1,972 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.

How can I make .exe from .py file with py2exe on Python2.2.3 (WinXP)

1
Hi!

Python v2.2.3
Py2Exe v0.3.1.win32-py2.2

I have a little problem with making of .exe file from .py file.

I tried this discreption: http://www.py2exe.org/index.cgi/Tutorial#Step1
but not work for me.

I wrote one example setup.py file, and hello.py.
hello.py:
Expand|Select|Wrap|Line Numbers
  1. print 'Hello word - Test executable python file'
  2. x = 0
  3. while x != 10:
  4.     x += 1
  5.     print str(x)+',',
  6.     if x == 10:
  7.         print '\nThe program is finished'
  8.  
setup.py:
Expand|Select|Wrap|Line Numbers
  1. from distutils.core import setup
  2. import py2exe
  3. setup(console=['helllo.py'])
  4.  
I opened cmd in the C:\Python22\ folder and I runned this script:
Expand|Select|Wrap|Line Numbers
  1. python setup.py py2exe
And I got the warn message;
Expand|Select|Wrap|Line Numbers
  1. c:\Python22\lib\distutils\dist.py:215: UserWarning: Unknown distribution option:
  2.  'console'
  3.  warnings.warn(msg)
  4. running py2exe
  5. Traceback (most recent call last):
  6.   File "setup.py", line 4, in ?
  7.     setup(soncole=['hello.py'])
  8.   File "C:\Python22\lib\distutils\core.py", line 138, in setup
  9.     dist.run_commands()
  10.   File "C:\Python22\lib\distutils\dist.py", line 138, in run_commands
  11.     self.run_commands(cmd)
  12.   File "C:\Python22\lib\distutils\dist.py", line 138, in run_command
  13.     cmd_obj.run()
  14.   File "C:\Python22\Lib\site-packages\py2exe\build_exe.py", line 254, in run
  15.     raise "Error", "Nothing to do"
  16. Error: Nothing to do
  17.  
images:
The script.
The warning.

So, what can I do to work for me?

Sorry for my bad english.
Jun 1 '12 #1
0 1334

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

Similar topics

3
by: Mike James | last post by:
First, the question - I remember reading in a bug report that there's a limit on the number of files you can open in Windows using Sun Java (around 2040 files). Can anyone verify this - or point me...
3
by: Dennis Hotson | last post by:
I'm having trouble adding a file to a .zip file using python2.3. The write method of a ZipFile object needs a filename in order to add a file to the archive. The problem is that I want to add a...
1
by: Tim N. van der Leeuw | last post by:
Hi, When trying to use win32com functionality with Python2.4, the interpreter often crashes! I don't know if it's a known problem already that will be fixed in an upcoming Python2.4.1...
2
by: Miki Tebeka | last post by:
Hello All, I'm shipping an application using py2exe. With Python2.3 it worked fine but when switching to Python2.4 I started getting "warning: string/unicode conversion" all over the place. ...
12
by: Yandos | last post by:
Hello all, why is the file 257 bytes long in windows xp, when it contains only 256 characters?: #include <stdio.h> int main(void) { int i; FILE *out; if ((out = fopen("256.tmp", "w")) ==...
79
by: pinkfloydhomer | last post by:
I want to scan a file byte for byte for occurences of the the four byte pattern 0x00000100. I've tried with this: # start import sys numChars = 0 startCode = 0 count = 0
1
by: Marco Osvaldo | last post by:
Hi to all, I would like to be able to copy & paste a file. I think the file type in WinXP is the DataFormats.FileDrop. So I have an object .... IDataObject myObject = (IDataObject)...
3
by: rzed | last post by:
I create a zip file on my WinXP system, using this function: <fn> import zipfile import os import os.path def zipdir(dirname, zfname): zf = zipfile.ZipFile(zfname, 'w',...
3
by: python | last post by:
I installed it, but can't find py2exe.exe in my computer. why? And , when I execute "python setup.py py2exe" under command line, it prompt error:wrong command "py2exe" .
3
by: vajratkarviraj | last post by:
i hav python2.5, matplotlib0.90.1, and py2exe for python 2.5 all on windows xp... i hav a python program(letsc.py) which uses the matplotlib package... and i want 2 make an exe of it for distribution...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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: 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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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
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.