Member Avatar

I have the following section of code that works perfectly when I run it as a .py file. When I convert it to a .exe using py2exe it appears that the linecache.getline() function is not working properly. I am able to create and write the .txt file fine, so I believe the linecache function is the issue. Is there any workaround for this that does not use linecache to read a specified line from a textfile or is there a way to get linecache to work with Py2exe? server = "en15" pagenum = "0" page = urllib.urlopen('http://www.westforts.com/%s/battles/page/%s' % (server, pagenum)) …

Member Avatar
+0 forum 3
Member Avatar

Hi, I have created TY.py. The Ty.py file executes and runs successfully. I am trying to make its executable using py2exe and by creating setup.py. It is not able to include the requests. I think it is because 'requests' is not present in 'include' folder for python27. The path of the requests library is at C:\Python27\Lib\site-packages\requests. I do not know where and how I should tell my setup.py about requests. Setup.py from distutils.core import setup import py2exe setup( console=['Ty.py'], options={ 'py2exe': {'includes': ['lxml.html', 'lxml._elementpath', 'lxml.etree','gzip','requests']}, } ) Ty.py import requests, lxml.html,csv si = requests.Session() response = si.post("https://www.lacrossealerts.com/login/", data={'username': 'name123', 'password': …

Member Avatar
+0 forum 1
Member Avatar

I am using Python 2.7.8. I installed the following: py2exe-0.6.9.win32-py2.7.exe and pywinusb-0.3.3 I have a script that I am trying to run. When I do I get the following error: C:\Python27\MyScripts\VMS\Python_Firmware_Upgrader-4_00_02\Python_Firmware_Upgrader\python-msp430-tools\win32>python ./setup-combined-tools py2exe.py changed directory to C:\Python27\MyScripts\VMS\Python_Firmware_Upgrader-4_00_02\Python_Firmware_Upgrader\python-msp430-tools running py2exe *** searching for required modules *** Traceback (most recent call last): File "./setup-combined-tools-py2exe.py", line 47, in <module> zipfile = "lib/shared.zip", File "C:\Python27\lib\distutils\core.py", line 151, in setup dist.run_commands() File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands self.run_command(cmd) File "C:\Python27\lib\distutils\dist.py", line 972, in run_command cmd_obj.run() File "C:\Python27\lib\site-packages\py2exe\build_exe.py", line 243, in run self._run() File "C:\Python27\lib\site-packages\py2exe\build_exe.py", line 296, in _run self.find_needed_modules(mf, required_files, required_modules) File "C:\Python27\lib\site-packages\py2exe\build_exe.py", line 1297, …

Member Avatar
+0 forum 1
Member Avatar

Hi everyone, I have 4 .py files : main.py , file1.py , file2.py , file3.py as : main.py: import sys import file1 import file2 import file3 def main(a,b): c=file1.somme(a,b) d=file2.mul(a,b) file3.div(a,b) print c,d if __name__ == '__main__': a,b=sys.argv[1:] a=int(a) b=int(b) main(a,b) file1.py: def somme(i1,i2): return i1+i2 file2.py: def mul(i1,i2): return i1*i2 file3.py: def div(i1,i2): return i1/i2 I would like to create main.exe so I tried to write the following setup.py file: from distutils.core import setup import py2exe import sys includes=['src/file1.py','src/file2.py','src/file3.py'] setup( options = {"py2exe": {"compressed": 2, "optimize": 2, 'bundle_files': 3, 'dist_dir': 'dist', "includes":includes, } }, console=['src/main.py'] ) but when I …

Member Avatar
+0 forum 2
Member Avatar

Hello everyone! I have made a game intended for the Rasberry pi in python. It is called Pi Blocks, but all of my friends with windows want to play it, so I've been trying and trying to get the game into an exectutable format, but nothing seems to work! I've tried just about everything the internet has to offer.. so, does someone smarter than me want to convert this to an exe?: [Download this and convert it please :)](http://host-a.net/u/PlanetForgeGame/Pygame_game.zip)

Member Avatar
+0 forum 4
Member Avatar

Dear members, i have a question. I created my software (with windows made with wxpython) and with py2exe I embed the icon into the exe. Since I would like to add the same icon file (or any other image) also as decoration in the window but I don't want to let the icon file outside the "None" zip file that py2exe generates, is there a way to do this? I mean, may I access a bitmap from the py2exe archive and use it inside a wxpython window? Sorry but I don't know how else to explain it. Thanks for your …

Member Avatar
+0 forum 1
Member Avatar

Platforms: Windows 7/Mac OS X ActiveState Python 2.7.2 Installed docx on Windows 7 at D:\Program Files (x86)\Python27\Lib\site-packages. Installed docx on OS X at /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages Following is the sample script (named as docx_example.py), which runs absolutely fine on the python interpreter: #!/usr/bin/env python ''' This file makes an docx (Office 2007) file from scratch, showing off most of python-docx's features. If you need to make documents from scratch, use this file as a basis for your work. Part of Python's docx module - http://github.com/mikemaccana/python-docx See LICENSE for licensing information. ''' from docx import * if __name__ == '__main__': # Default set …

Member Avatar
+0 forum 1
Member Avatar

Hi guys, converting .ui to .py to .exe using Qt Designer (PyQt4), Python 2.7, and py2exe Ive been able to do this with Tkinter gui's but having problems with gui's from Qt Designer? First error was due to missing msvcp90.dll which ive downloaded and copied into the python dll directory, and i no longer get that error... but now i am getting other errors and i do not know what to do about them? Here is some printout from my command prompt (not python code, but i'm sure most of you know this :) this is from the end of …

Member Avatar
+0 forum 3
Member Avatar

Just wanted to point out for anyone using py2exe that it apparently doesn't always (or maybe ever) raise AssertionErrors. It's been a while since they've updated the program so it's probably just easier to implement a workaround for those of us who use this compiler. I've noticed it not raising the error in a variety of circumstances. Here's the workaround I implemented. python 2.7.2 py2exe 0.6.9 [CODE=python]def _assert(assertion): # workaround for py2exe not # raising assertion errors if not assertion: raise AssertionError[/CODE] ps please don't lecture me on why I shouldn't use assert

+0 forum 0
Member Avatar

I am having trouble compiling an exe. I tried both py2exe and cxfreeze with similar results, I made an exe but it didn't work. I figured out that I needed to send the image files and sounds with it (should have thought of that to begin with). Now that I added the code for that I get a syntax error: >c:\python26\python.exe setup.py py2exe SyntaxError: data_files=("images\menu_items", ^ Here is a copy of the code from my setup file. [CODE] from distutils.core import setup import glob import py2exe setup(console=["TargetPracticeV11.pyw", data_files=("images\menu_items", [glob.glob("images\menu_items\\*.gif"), glob.glob("images\menu_items\\*.png"), glob.glob("images\menu_items\\*.jpg")]), ("images\menu_items\\buttons", [glob.glob("images\menu_items\\buttons\\*.gif"), glob.glob("images\menu_items\\buttons\\*.png")]), ("images\\level_objects", [glob.glob("images\level_objects\\*.gif"), glob.glob("images\level_objects\\*.png")]), ("sounds", [glob.glob("sounds\\*.wav"), glob.glob("sounds\\*.mid"), …

Member Avatar
+0 forum 2
Member Avatar

Hi everybody, I completed my scripts and I managed to compile them with py2exe. This script will edit some images and will save the output in a specific subfolder of the program (if the user will install it in the default location it will be something like c:\program files\MyProgram\output The problem is that, for instance, guest users will not have writing access to the output folder since it is in the program files folder. Is there a way to give to all the users of a computer the right to read and write my program folder (and its subfolder and …

Member Avatar
+0 forum 2
Member Avatar

I'm hoping I'm not the first to deal with this issue but here goes. running py2exe I get this error [CODE]Traceback (most recent call last): File "setup.py", line 4, in (module) setup(console=['hello.py']) File "C:\Python27\lib\distutils\core.py", line 152, in setup dist.run_commands() File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands self.run_command(cmd) File "C:\Python27\lib\distutils\dist.py", line 972, in run_command cmd_obj.run() File "C:\Python27\lib\site-packages\py2exe\build_exe.py", line 243, in run self._run() File "C:\Python27\lib\site-packages\py2exe\build_exe.py", line 305, in _run dlls = self.find_dlls(extensions) File "C:\Python27\lib\site-packages\py2exe\build_exe.py", line 389, in find_dlls self.dll_excludes) File "C:\Python27\lib\site-packages\py2exe\build_exe.py", line 1021, in find_dependend_dlls import py2exe_util ImportError: DLL load failed: %1 is not a valid Win32 application.[/CODE]

Member Avatar
+0 forum 5
Member Avatar

Currently running python 2.7 on windows 7. I have an app created with wx python and compiled with py2exe. This app has an update utility that polls an update server at startup. If an update is found it downloads the new executable file (approx. 7mb) and makes the switch. It works well, but when I change 3 lines of code and publish an update the end user has to again download an entire 7+ mb file. I know that py2exe creates a zip archive containing the .pyo's and I would like to be able to add/remove/overwrite those .pyo files while …

+0 forum 0
Member Avatar

I created python executable with py2exe. In my program, I use the pywin32 module. [U][B]Details of the SW's[/B][/U] OS Window 7 64 Bit Python 2.6 pywin32-214.win32-py2.6 when i created the exe its working fine on other system running Windows 7 but giving below error when running on Windows XP systems... [code] Traceback (most recent call last): File "program.py", line 11, in <module> File "win32com\__init__.pyc", line 5, in <module> File "win32api.pyc", line 12, in <module> File "win32api.pyc", line 10, in __load ImportError: DLL load failed: The specified procedure could not be found. [/code] kindly suggest me how to resolve the issue... …

+0 forum 0
Member Avatar

Hi I'm using pysnmp 4.1.1.4a (yes, I know there's a newer version but it has the same behavior) and py2exe. When I execute a pysnmp oneliner, like this: [CODE] errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().nextCmd( cmdgen.CommunityData('my-agent', 'public', 0), cmdgen.UdpTransportTarget((self.IPaddress, self.Port)), self.keydict[ key ][0] [/CODE] I get this output: [CODE] File "pysnmp\entity\rfc3413\oneliner\cmdgen.pyc", line 116, in __init__ File "pysnmp\entity\engine.pyc", line 16, in __init__ File "pysnmp\proto\rfc3412.pyc", line 16, in __init__ File "pysnmp\smi\builder.pyc", line 143, in __init__ File "pysnmp\smi\builder.pyc", line 35, in init File "pysnmp\smi\builder.pyc", line 80, in _init ImportError: No module named mibs.instances [/CODE] Pysnmp clains to be py2exe friendly. Anyone got a …

Member Avatar
+0 forum 4
Member Avatar

Been banging at this all day HELP! I had to go back to Python 2.5 from 2.6 and now everytime I try and run my setup.py py2exe it gives me the error that it cannot find the python26.dll. I have uninstalled and reinstalled and even went into the registry and deleted everything python26 related and still get the same error. What am I missing? Using python-2.5.1.msi pywin32-214.win32-py2.5.exe py2exe-0.6.9.win32-py2.5.exe Thanks, Steve

+0 forum 0
Member Avatar

Im having troubles learning how to make an executable so can someone show me what Im doing wrong [import time from cx_Freeze import setup, Executable setup( name = "hello", version = "0.1", description = "the typical 'Hello, world!' script", executables = [Executable("hello.py")]) [GO AHEAD AND IGNORE THE REST OF THE CODE I DONT THINK IT MATTERS] print('Hello World!!!!') time.sleep(1) print ('what is your name?') name = input() a = ('Hello ') b = (' my name is com') string = a+name +b print (string) time.sleep(2) print('What is your favorite color?') color = input() c= ('Thats awesome ') print(c+name) time.sleep(2) d=(' …

Member Avatar
+0 forum 21
Member Avatar

:SHave they made a py2exe 3.0 yet and if so where in the internet can you find or have they just not made one yet?:confused: If not how else can I turn my programs into executables?:-/

Member Avatar
+0 forum 6
Member Avatar

Hey guys, I recently found out how to make .py an exe using py2exe and I also found another program called "Smart Install Maker." I bought the license and wanted to let you know if you want to send me your .py, I will package it for you for free. Just send to my email: [email]admin@pedrumgolriz.com[/email] Here is an example of what I'm talking about: [url]http://pedrumgolriz.com/index/?p=103[/url] So if you are interested email me with the desired product name, an icon (must be in .ico format and 48x48px), desired shortcuts, and version number. Edit:: Also, if you have a readme you …

Member Avatar
+0 forum 3
Member Avatar

Hey All, I have made a program called "Pymailer", I have even made a GUI version... now what I want to do is to convert it to .exe format... how do I do it? I googled for some info, but in vain!

Member Avatar
+0 forum 7
Member Avatar

when using the data_files option in my setup.py #!/usr/bin/env python import ctypes from OpenGL.platform import win32 from distutils.core import setup import py2exe import sys sys.path.append("dist") setup(options = {"py2exe": {"compressed": 1, "optimize": 2, "includes": ["ctypes","Tkinter","Numeric"], "excludes": ["OpenGL"] }}, zipfile = None, data_files=['msvcr71.dll', glut32.dll'], windows=['myprogram.py'] ) I get an error saying msvcr71.dll is not found. It exists in `C:\windows\system32`. If I specify its full path then I get a similar message about glut32.dll. That one exists in the python site libs. If I include it I get an executable but it doesn't work. I wonder though, whether py2exe can find those dll's …

Member Avatar
+0 forum 2
Member Avatar

Hello, I am trying to compile a working opengl project into an executable for windows. I ran into several import issues in the python imaging library, Numeric, and OpenGL. I managed to resolve all but the OpenGL ones. There is quite a bit of conflicting info on the subject out there and I've tried about everything I've found. I've tried the method of using exclude="OpenGL" and putting the OpenGL folder in my dist directory. I got the following errors when running py2exe: The following modules appear to be missing: ['OpenGL.GL', 'OpenGL.GLU','OpenGL.GLUT','OpenGL.platform'] I get an executable but nothing happens when I …

Member Avatar
+0 forum 2

The End.