py2exe

Matplotlib in py2exe — ImportError: cannot import name dist (File “distutils\__init__.pyc”)

落爺英雄遲暮 提交于 2021-02-18 12:09:45
问题 Matplotlib working in this app perfectly.. but not working in build for some reason. Why? I'll gladly take any advice that can help me. .exe.log : Traceback (most recent call last): File "main.py", line 3, in <module> File "zipextimporter.pyc", line 82, in load_module File "matplotlib\__init__.pyc", line 103, in <module> File "zipextimporter.pyc", line 82, in load_module File "distutils\__init__.pyc", line 25, in <module> ImportError: cannot import name dist main.py is a script that I'm

Matplotlib in py2exe — ImportError: cannot import name dist (File “distutils\__init__.pyc”)

微笑、不失礼 提交于 2021-02-18 12:09:43
问题 Matplotlib working in this app perfectly.. but not working in build for some reason. Why? I'll gladly take any advice that can help me. .exe.log : Traceback (most recent call last): File "main.py", line 3, in <module> File "zipextimporter.pyc", line 82, in load_module File "matplotlib\__init__.pyc", line 103, in <module> File "zipextimporter.pyc", line 82, in load_module File "distutils\__init__.pyc", line 25, in <module> ImportError: cannot import name dist main.py is a script that I'm

Where to put images folder in python exe?

时光总嘲笑我的痴心妄想 提交于 2021-02-16 18:35:47
问题 I have converted a python game I designed into an exe. Running the exe itself causes it to flash and then close, meaning an error has occured. Running it from the Command Prompt causes the error as well, but documents it: Cannot load image: Playfield.png Couldn't open images\Playfield.png This is telling me that the load_image block is failing. I have encountered this before when I did not have an images directory. I attempted to move the images folder to the dist directory. This is the error

Embed a .wav file in Python with pyinstaller

那年仲夏 提交于 2021-02-16 14:12:53
问题 This is the code I am running: import tkinter from pygame import mixer root = tkinter.Tk() mixer.init() mixer.music.load(r'C:\Users\George\AppData\Local\Programs\Python\Python36-32\Scripts\Music\Am_lie_-_JY_Suis_Jamais_All_-Yann_Tiersen.wav') mixer.music.play() root.mainloop() I convert this to windows .exe with py2exe giving: pyinstaller -w -F -i "C:\Users\George\AppData\Local\Programs\Python\Python36-32\Scripts\test.ico" sound.py What I want to do is make the wav file embedded in the python

Error while trying to compile Python script to exe

笑着哭i 提交于 2021-02-11 12:47:23
问题 I'm trying to compile python script to exe. My script - hello.py : print("hello") My setup.py : from distutils.core import setup import py2exe, sys, os sys.argv.append('py2exe') setup( name = 'hello', description = 'hello script', version = '1.0', options = {'py2exe': {'bundle_files': 1, 'compressed': True,'dist_dir': ".",'dll_excludes':['w9xpopen.exe']}}, console = [{'script': r"hello.py"}], zipfile = None, ) I run: py -3 setup.py install The error: py -3 setup.py install running install

How to handle console exit and object destruction

蹲街弑〆低调 提交于 2021-02-11 09:47:52
问题 Given this code: from time import sleep class TemporaryFileCreator(object): def __init__(self): print 'create temporary file' # create_temp_file('temp.txt') def watch(self): try: print 'watching tempoary file' while True: # add_a_line_in_temp_file('temp.txt', 'new line') sleep(4) except (KeyboardInterrupt, SystemExit), e: print 'deleting the temporary file..' # delete_temporary_file('temp.txt') sleep(3) print str(e) t = TemporaryFileCreator() t.watch() during the t.watch() , I want to close

Py2Exe error caused by pywinauto on some systems: “AttributeError: 'module' object has no attribute 'CUIAutomation”

倖福魔咒の 提交于 2021-02-10 14:16:27
问题 I'm rolling out an EXE to several Windows 2012 R2's and the majority of them work just fine. However, seemingly under the same condition, I have a handful that spit out the error: AttributeError: 'module' object has no attribute 'CUIAutomation' I used to just have: from pywinauto.findwindows import find_window from pywinauto.win32functions import SetForegroundWindow And I tried also adding in: import pywinauto But that didn't do much. I also attempted to change the code so instead of using

Understanding what files in the TCL are required for distributing frozen Python Tkinter apps

徘徊边缘 提交于 2021-02-10 07:52:46
问题 I'm trying to figure out which files in Python's (Python 2.6/Python 2.7) tcl folder are required in order to distribute frozen Python Tkinter apps using Py2exe or similar. The quick and dirty way to do this (using pyexe as an example) is to follow the 2nd example on the following page and then xcopy your python's tcl folder to your dist folder (as a tcl sub-folder). http://www.py2exe.org/index.cgi/TixSetup The problem with the xcopy tcl technique is that it copies 100's of extra files that

Py2exe missing modules when bundling

左心房为你撑大大i 提交于 2021-02-08 08:30:57
问题 Before I start, I've checked out this question and I already have a windows=[] in my setup.py. Note that I named the script I want to convert Tkinter.py. Here's my setup.py: from distutils.core import setup import py2exe setup( windows=['Tkinter.py'], options={ "py2exe":{ "bundle_files":1, } } ) Here is the error: C:\Users\Julian\Desktop\Tkinter>python setup.py py2exe running py2exe 3 missing Modules ------------------ ? readline imported from cmd, code, pdb ? win32api imported from platform

IO Error:Cannot open image while generating barcode after freezing using py2exe

断了今生、忘了曾经 提交于 2021-02-04 20:47:25
问题 I have used pyBarcode library to generate Barcode in my software and its works perfectly fine while I load it from command line but once I freeze the entire software using py2exe I am getting IO error while generating the barcode. File "panels.pyc", line 383, in generate File "barcodeGenerator.pyc", line 9, in generate File "barcode\base.pyc", line 68, in save File "barcode\codex.pyc", line 251, in render File "barcode\base.pyc", line 103, in render File "barcode\writer.pyc", line 188, in