py2exe

Help converting .py to .exe, using py2exe

不问归期 提交于 2019-12-11 14:54:27
问题 The script I ran # p2e_simple_con.py # very simple script to make an executable file with py2exe # put this script and your code script into the same folder # run p2e_simple_con.py # it will create a subfolder 'dist' where your exe file is in # has the same name as the script_file with extension exe # (the other subfolder 'build' can be deleted) # note: with console code put a wait line at the end from distutils.core import setup import py2exe import sys sys.argv.append("py2exe") sys.argv

py2exe python24 numpy error AttributeError “dtype”

风流意气都作罢 提交于 2019-12-11 12:59:14
问题 from distutils.core import setup import py2exe from distutils.filelist import findall import os import matplotlib matplotlibdatadir = matplotlib.get_data_path() matplotlibdata = findall(matplotlibdatadir) matplotlibdata_files = [] for f in matplotlibdata: dirname = os.path.join('matplotlibdata', f[len(matplotlibdatadir)+1:]) matplotlibdata_files.append((os.path.split(dirname)[0], [f])) packages = ['matplotlib', 'pytz'] includes = [] excludes = [] dll_excludes = ['libgdk_pixbuf-2.0-0.dll',

Why does py2exe stop at “running”?

被刻印的时光 ゝ 提交于 2019-12-11 12:45:29
问题 I want to create an .exe file from a .py script using py2exe under Windows 7 and Anaconda. So I created a setup.py file: from distutils.core import setup import py2exe setup(console=['mouseMove.py'], options = {'py2exe': {'packages': ['pyautogui']}}) Now I navigate in the Windows-CMD to the directory which "mouseMove.py" and "setup.py" exists and start: python setup.py py2exe In the cmd window its written "running py2exe" and it remains in this state, nothing else happens. Does anyone know

How to execute console EXEs without spawning a new console window?

回眸只為那壹抹淺笑 提交于 2019-12-11 12:22:12
问题 I have a Python script which is usually called from the Windows PowerShell, with some command line arguments. I want to distribute this script in a .exe format, and I want to keep the same "user interface", based on the console, for its usage. The user opens the Windows Powershell. The user calls the myscript.exe program from the shell: myscript.exe argument1 argument2 argument3 The program executes in the same console and writes its output in the same console . Actually I have a myscript.exe

ImportError: no module named PIL when opening the .py file directly in Windows

北城余情 提交于 2019-12-11 10:45:22
问题 This is a rather complicated problem. My Python script uses the module PIL which is loaded by: from PIL import ImageTk, Image The script works fine in the IDE and also when I start it from the cmd: python script.py But when I try to open it by double-clicking it gives the ImportError: no module named PIL. I'm using python 2.7 in Anaconda. I uninstalled PIL and installed Pillow, but the problem persists. I copied the PIL directory to the working directory, but then I get ImportError: DLL load

Py2Exe: avoid windows to request permission to execute .exe file

こ雲淡風輕ζ 提交于 2019-12-11 10:14:45
问题 I have a py2exe-built program which is executed directly from the console (Windows Powershell). Involved modules are: xlrd and PrettyTable. Unfortunately, each time the program is called, Windows asks the user for a confirmation, as the program would need particular privileges. This is undesirable as the script is "safe" for the system. It just gets text files as arguments and outputs a text file, in the same folder. I don't want the user to be scared by this permission request. Is there any

How to compile python code that uses boto to access S3?

人盡茶涼 提交于 2019-12-11 10:05:43
问题 I'm trying to compile a simple Python program, that uploads files to an S3 bucket using the boto package, in to a single, redistributable .exe file. I'm open to any compilation method. So far I've tried both bbfreeze and py2exe and both yield the same results. The code in question that causes trouble looks like this: import boto #...snip... fname_base = os.path.basename(fname) s3 = boto.connect_s3(aws_access_key_id=_aws_key, aws_secret_access_key=_aws_secret_key, is_secure=False); bucket = s3

Hiding command prompt in wxpython app

吃可爱长大的小学妹 提交于 2019-12-11 09:03:26
问题 I have written a gui application using wxpython and converted it into an executable using py2exe. However whenever I run the executable, the command prompt comes up in the background and closes when i exit the program. Is there any way to not make it appear? 回答1: You propply set the application type to console in py2exe setup: setup(console=... while you need to make it windows : setup(windows=... Here I have a simple wxpython application in a file named example.pyw : # -*-coding: utf-8 -*- #

Requests lib and py2exe COM server issue

烂漫一生 提交于 2019-12-11 08:17:24
问题 I'm working in a Com Server DLL where I use requests to make POST a multipart form along with some XML file. Localy, it works great and with no error. I can call the COM object methods and it returns me what I'm expeting to. Now, when I use py2exe to build a dist version of the app, and try to register the DLL Com Server with regsvr32, I get the following error: "Runtime Error! ... R6034 An application has made an attempt to load the C runtime library incorrecly. ..." Also, I've noticed that

py2exe gives RuntimeError: Too early to create image

做~自己de王妃 提交于 2019-12-11 06:49:31
问题 This python27 32bit code runs perfectly in IDLE, but when packaged by py2exe... not so good. This is not a duplicate of the missing Tk() question. Something else appears to be uninitialized when running the py2exe generated executable, the call at ImageTk.PhotoImage() balks with 'too early to create image': C:\python\python_ui\exe\dist>basic.exe Traceback (most recent call last): File "basic.py", line 7, in <module> File "PIL\ImageTk.pyo", line 117, in __init__ File "Tkinter.pyo", line 3367,