py2exe

python GUI to EXE with image and modules

南笙酒味 提交于 2019-12-25 12:09:56
问题 I have created a Python GUI and trying to convert it to .exe with py2exe. i am using following modules wx,matplotlib,numpy,time,serial,random and a .ico image as logo. i tried create a setup.py file but it didn't work.need help creating setup file to generate .exe of my GUI. 回答1: It would be convenient if you could provide some details regarding why the .EXE is not being created. If you can't provide the details then please go through these questions on Stackoverflow, they maybe helpful: How

Include gspread module using py2exe, pyinstaller

≡放荡痞女 提交于 2019-12-25 09:59:12
问题 I have created a python application which fetches data from a google spreadsheet and performs the required operation and outputs files with the data accordingly. The application works fine through my ide and the console. I'm using gspread and Tkinter for accessing the google sheets and for the GUI respectively. However when I try to create it into an exe. I keep running into errors. First I tried using py2exe but I keep getting the error ImportError: No module named gspread My setup.py is

pyqt jpeg support not working in bundled form

时光总嘲笑我的痴心妄想 提交于 2019-12-24 20:59:37
问题 To enable jpeg support in a PyQT application, you have to manually include the qjpeg4.dll . It works fine when the dll and pyd file are not bundled together in the final exe. For example with py2exe you can do the following : DATA=[('imageformats',['C:\\Python26/Lib/site-packages/PyQt4/plugins/imageformats/qjpeg4.dll'])] setup(console=[{"script":"cycotic.py"}], data_files = DATA, options={"py2exe":{ "includes":["sip"], "excludes":MODULE_EXCLUDES, "bundle_files":3, "compressed":False, "xref"

python 3 how to put pics inside my program

旧城冷巷雨未停 提交于 2019-12-24 17:53:09
问题 I have a program and couple of pics which I use in the program. icon.addPixmap(QtGui.QPixmap("logo_p3.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.label_6.setPixmap(QtGui.QPixmap("Logo-4.jpg")) Pics are in the same folder with the program. Is there any way to put pics INSIDE the program? (While they are just in the folder they can be easily changed or deleted, and I don't want it to happen) May be something like this: k=b'bytes of pic here' self.label_6.setPixmap(QtGui.QPixmap(k)) or any

Py2exe ImportError: No module named shell

耗尽温柔 提交于 2019-12-24 14:08:26
问题 My code is: from win32com.shell import shellcon from win32com.shell.shell import ShellExecuteEx And it works fine in IDLE but after i make the exe i get the error: File "Myfile.py", line 1, in <module> ImportError: No module named shell Why can't py2exe import win32com.shell ? 回答1: The following may help you out: py2exe.org win32com.shell The link describes the problem as being that win32com performs some "magic" to allow loading of COM extensions during run time. The extensions reside in the

Creating executable for Python 2.7, getting RuntimeError: maximum recursion depth

对着背影说爱祢 提交于 2019-12-24 12:47:03
问题 I am running Python 2.7. I downloaded py2exe version 0.6.9 win32 to create an executable out of my .py file. I know it is an older version so I'm not sure if that's what's creating the error. I have gone through the steps: creating a setup.py file: from distutils.core import setup import py2exe setup(console=["MyFileName.py"]) Then running python setup.py py2exe --help from the command window, then python setup.py py2exe However, it turns up a RuntimeError: maximum recursion depth exceeded

Error while transforming .py to .exe

梦想与她 提交于 2019-12-24 09:09:06
问题 When I try to transform my script in an executable, I get this error after it's done: Traceback (most recent call last): File "shd-WinResize.py", line 4, in <module> File "zipextimporter.pyo", line 98, in load_module ImportError: MemoryLoadLibrary failed loading win32api.pyd I'm using this script to convert: from distutils.core import setup import py2exe import sys sys.argv.append('py2exe') setup( options = {'py2exe': dict(bundle_files=1, optimize=2)}, windows = ["shd-WinResize.py"], zipfile

Pygame font not working after py2exe

拟墨画扇 提交于 2019-12-24 08:17:44
问题 I have this code that works fine when I convert it to an .exe with py2exe, except when it tries to load text on the screen. It comes up with the error: C:\Users\Slinky\Desktop\dist\FlappyBat.exe:120: RuntimeWarning: use font: DLL load failed: The specified module could not be found. (ImportError: DLL load failed: The specified module could not be found.) Traceback (most recent call last): File "FlappyBat.py", line 176, in <module> File "FlappyBat.py", line 120, in main File "pygame\__init__

py2exe cannot import Module from other directory

别来无恙 提交于 2019-12-24 05:20:19
问题 I am bundling python source code with py2exe. The directory structure is as follows: some_Mod.py some_dir/another_dir/some_Mod.py Inside the latter some_dir/another_dir/some_Mod.py I am trying to import the other Python Module with from ..some_Mod import * Using the import causes no problems with the python interpreter, but if I run the same constellation in the bundled package, I get an Exception: ImportError: No module named some_Mod Can somebody explain why? Remark: Renaming the Modules is

py2exe cannot import Module from other directory

心已入冬 提交于 2019-12-24 05:20:02
问题 I am bundling python source code with py2exe. The directory structure is as follows: some_Mod.py some_dir/another_dir/some_Mod.py Inside the latter some_dir/another_dir/some_Mod.py I am trying to import the other Python Module with from ..some_Mod import * Using the import causes no problems with the python interpreter, but if I run the same constellation in the bundled package, I get an Exception: ImportError: No module named some_Mod Can somebody explain why? Remark: Renaming the Modules is