Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old March 1st, 2003, 02:26 PM
marron79's Avatar
marron79 marron79 is offline
Rut row Raggy!
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jul 2001
Location: Tornado Alley
Posts: 558 marron79 User rank is Private First Class (20 - 50 Reputation Level)marron79 User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 9 h 41 sec
Reputation Power: 8
Question Error loading Python script as .exe

I made a Python script based on the sample program I found here:

http://wiki.wxpython.org/index.cgi/...pp?action=print

I also made the setup.py and setup.cfg files as printed in that article.

But, when I compiled it into a .exe file using py2exe, I get the an error saying something like "python22.dll was not found," when the .exe file is opened on another computer (with Python not installed). Why is this? I thought the goal of py2exe was to allow Python programmers to deploy their creations to computers w/out Python. Did I miss something? If worse comes to worse, I can always compile the .exe file into a installer program with python22.dll, but where should it be installed? Thanks to anyone who can help!!
__________________
Matt

Reply With Quote
  #2  
Old March 10th, 2003, 09:14 PM
techsplicer techsplicer is offline
TROGDOR the BURNINATOR
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: Northern CA
Posts: 2 techsplicer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Cool Error loading Python script as .exe

When you complie a python script with py2exe, the dist directory contains all of the files needed to run the application. Sometimes it will contain the python22.dll file, but mostly (in every case that i have built applications with py2exe) the files in the dist directory are .pyd files. These are essentially .dll files with the extension renamed to .pyd

Now, when you install the built application on a computer with out python installed, the library files (which is essentially what the python22.dll file is) need to be in a location that either the OS or the program can find. On a windows system, it is usually easiest to install them into the application directory. You can also install the python22.dll file into a location in you system path (something like "c:/windows/system32", or "c:/winnt/system32").

If you would like an example of an installer or need a visual concept of what i am talking about, please email me and ill be happy to help out.

Oh, forgot to mention that the executable create with py2exe is merely a zip archive that contains all of the .pyc files for you application and is set to execute you main file when you double click the .exe

Last edited by techsplicer : March 10th, 2003 at 09:50 PM.

Reply With Quote
  #3  
Old March 11th, 2003, 02:29 PM
marron79's Avatar
marron79 marron79 is offline
Rut row Raggy!
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jul 2001
Location: Tornado Alley
Posts: 558 marron79 User rank is Private First Class (20 - 50 Reputation Level)marron79 User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 9 h 41 sec
Reputation Power: 8
Thanks for the info techsplicer. I'm surprised how few Python fans there are here! Anyway, I was hoping all that was needed was the .exe file, but stuffing them into a setup .exe is no big deal. I downloaded a free program called InoSetup or something like that. Haven't tested it out with my own program, but it looks pretty simple. My main question was were the setup script was suppose to put the .dll file(s). So it needs to be in the system folder? I figured that, but wanted to make sure it couldn't also be left in the program's folder (in Program Files), which would be easier b/c not everyone knows where their system folder is. BTW, I don't remember seeing any files in the dist folder other than the program and the .dll file. Thanks again!

Reply With Quote
  #4  
Old March 11th, 2003, 02:38 PM
techsplicer techsplicer is offline
TROGDOR the BURNINATOR
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Location: Northern CA
Posts: 2 techsplicer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
InoSetup is the same setup program that i use. It is quite handy and actually has some neat extensions to it.

Also, remember, that the library files (.pyd, .dll, etc.) can also be placed into the application directory (i.e. the location that you install the .exe). That is usually the easiest place to install them and to make sure that you dont overwrite another installations files (if they happen to have another py2exe compiled applicaiton installed).

As far as the dist directory goes, the number of files can varry depending upon the libraries that you imported (i.e. import sys, or from wxPython.wx import *).

Hope that this helps....

Reply With Quote
  #5  
Old March 11th, 2003, 06:00 PM
marron79's Avatar
marron79 marron79 is offline
Rut row Raggy!
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jul 2001
Location: Tornado Alley
Posts: 558 marron79 User rank is Private First Class (20 - 50 Reputation Level)marron79 User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 9 h 41 sec
Reputation Power: 8
Okay, that makes sense. I'm glad I can just save all the files from the dist directory into Program Files/my program's folder. That will make things easier on those who I send the programs to. Thanks again.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > Error loading Python script as .exe


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway