3 Replies - 3862 Views - Last Post: 04 July 2010 - 12:17 AM Rate Topic: -----

#1 Eric115  Icon User is offline

  • coderさん
  • member icon

Reputation: 63
  • View blog
  • Posts: 696
  • Joined: 19-January 09

Making an exe file

Posted 26 June 2010 - 09:10 PM

Hi,
The other day I wrote a program to backup my USB when I plug it into my home computer. I want to covert it to an exe file so I can distribute it and use it myself. I installed py2exe and pyinstaller. I need a single exe file with everything in it (I used PythonCard (.rsrc) to make a GUI). When I use py2exe I get this error:
"ImportError: DLL load failed with error code 193"
I have tried about 10 different setup.py scripts and they all come up with the same message.
So I thought I would try to use pyinstaller. The first time I tried it, it worked. Then i tried it on my program with the GUI and it didn't add in the GUI file to the exe. I looked on the internet everywhere and couldn't find how to add the .rsrc file into the exe file.
I need a single .exe file with everything in it. I run python25 on Windows 7 and I installed the py2exe for python25(x64 bit) and it had no problems installing. If anyone can help me fix the DLL error in py2exe or show me how to add in my GUI to pyinstaller-1.4 it would be greatly appriciated.
If you need to see my setup scripts or anything let me know (I have tried a lot of them for py2exe and they all get the same error. I have tried a few for pyinstaller as well but I am not sure how to use pyinstaller.).

Thanks in advance.

Is This A Good Question/Topic? 0
  • +

Replies To: Making an exe file

#2 atraub  Icon User is offline

  • Pythoneer
  • member icon

Reputation: 759
  • View blog
  • Posts: 2,010
  • Joined: 23-December 08

Re: Making an exe file

Posted 27 June 2010 - 07:03 AM

Just to be safe, let's start with seeing those setup scripts.
Was This Post Helpful? 0
  • +
  • -

#3 Eric115  Icon User is offline

  • coderさん
  • member icon

Reputation: 63
  • View blog
  • Posts: 696
  • Joined: 19-January 09

Re: Making an exe file

Posted 28 June 2010 - 01:38 AM

Ok these are the three scripts I had the most faith in:
from distutils.core import setup

# py2exe stuff
import py2exe, os
# find pythoncard resources, to add as 'data_files'
pycard_resources=[]
for filename in os.listdir('.'):
    if filename.find('.rsrc.')>-1:
        pycard_resources+=[filename]

# includes for py2exe
includes=[]
for comp in ['button',\
            'statictext']:
    includes += ['PythonCard.components.'+comp]
print 'includes',includes

opts = { 'py2exe': { 'includes':includes }}
# {'py2exe': {"bundle_files": 1, }}
print 'opts',opts
# end of py2exe stuff

setup(name='Syncher',
    version='1.0',
    url='about:none',
    author='Eric Goodwin',
    author_email='ericgoodwin008@hotmail.com',
    package_dir={'Syncher':'.'},
    packages=['Syncher'],
    data_files=[('.',pycard_resources)],
    console=['Syncher.py'],
    options=opts
    )


and
from distutils.core import setup
import py2exe
setup(
version = "1.0", name = "Syncher", author = 'Eric Goodiwin',
data_files=[('Syncher.rsrc.py')], console = ["Syncher.py"]  )



from distutils.core import setup
import py2exe
target = {
	'script': ['Syncher.py', 'Syncher.rsrc.py']
	}

setup(windows=[target],
	  name="Syncher",
	  options = {'py2exe': {"bundle_files": 1, }},
	  zipfile=None
	  )



These are the commands I used in pyinstaller(in cmd):

cd desktop\pyinstaller-1.4 (showing where the files are)
Makespec.py --onefile --noconsole -v1.0 -n Program_name -- Program.py
Build.py Program_name\Program.spec

These work and make a .exe file but it doesn't include the .rsrc gui in the file so it has to be an external file. I am having the most luck with pyinstaller so far.
Thanks for your quick reply
p.s If you need anything else let me know!
Was This Post Helpful? 0
  • +
  • -

#4 Eric115  Icon User is offline

  • coderさん
  • member icon

Reputation: 63
  • View blog
  • Posts: 696
  • Joined: 19-January 09

Re: Making an exe file

Posted 04 July 2010 - 12:17 AM

Maybe if anyone knows how to add in two or more .py files to be made .exe (in the one .exe file) I would be able to use that?
Any ideas?
thanks again
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1