py2exe

exe generated by py2exe and pyinstaller not working

故事扮演 提交于 2020-01-15 09:16:55
问题 I wrote a screenshot program using python and wanted to compile it as .exe file. So I tried with both py2exe and pyinstaller . My python version is 2.7.14 , 32bit. I use Windows 10. I also use virtual environment in this project. My code for the screenshot program is like below. I run it by python screenshot.py and it take a screenshot of my screen and stored it inside the save directory. from PIL import Image import pyscreenshot as ImageGrab import time time.sleep(3) save_dir = "C:/Users

Missing “six” module for astropy after using cx_freeze/py2exe

空扰寡人 提交于 2020-01-15 07:35:30
问题 I was trying to convert program written in python 3 to .exe using cx_freeze and py2exe. But after converting and running program i get the following error: Traceback (most recent call last): File "astroConverter.py", line 8, in <module> File "C:\Users\Konrad\PycharmProjects\astroConverter\mainwindow.py", line 2, in <module> from widgets.widgets import MainMenu, Toolbar, TextField File "C:\Users\Konrad\PycharmProjects\astroConverter\widgets\widgets.py", line 1, in <module> from widgets.menus

Print not working when compiled with py2exe

不羁的心 提交于 2020-01-13 08:43:11
问题 this is my very simple code, printing argvs: import sys argv=sys.argv for each in sys.argv: print each here's the output when ran: e:\python>python test1.py 1 2 3 4 5 test1.py 1 2 3 4 5 I want it to be compiled, so I made one with py2exe: e:\python>python setup.py py2exe and my setup.py: from distutils.core import setup import py2exe, sys, os sys.argv.append('py2exe') setup( options = {'py2exe': {'bundle_files': 3}}, windows = [{'script': "test1.py"}], zipfile = None, ) and I don't get any

Window Icon of Exe in PyQt4

自古美人都是妖i 提交于 2020-01-13 08:17:14
问题 I have a small program in PyQt4 and I want to compile the program into an Exe. I am using py2exe to do that. I can successfully set icon in the windows title bar using the following code, but when i compile it into exe the icon is lost and i see the default windows application. here is my program: import sys from PyQt4 import QtGui class Icon(QtGui.QWidget): def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.setGeometry(300, 300, 250, 150) self.setWindowTitle('Icon')

py2exe and Django Import Error no module named apps

こ雲淡風輕ζ 提交于 2020-01-13 05:11:51
问题 I'm trying to make a standalone Django (1.8.2) app using py2exe. To achieve that I have a setup.py file with all settings required by py2exe: modules to be included, not to include, etc. The py2exe console parameter (within my setup.py) is set to 'manage.py'. After running it with python setup.py py2exe py2exe runs succesfully adding all (?) required modules and my Django apps. I get an manage.exe file - seems this is working, right? However, after running the manage.exe file I get the

Cx_Freeze and Plotly

孤人 提交于 2020-01-11 14:07:43
问题 I am trying to build an exe of an application that uses plotly using cx_freeze. I have previously built the application using matplotlib but have switched the graphing over to plotly. I can build the application but when I try to plot, I get the following error. url = py.plot(fig, filename='pandas-box-plot') File "C:\Python34\lib\site-packages\plotly\offline\offline.py", line 284, in p lot get_plotlyjs(), File "C:\Python34\lib\site-packages\plotly\offline\offline.py", line 48, in ge t

Py2exe, Runtimeerror with tweepy

…衆ロ難τιáo~ 提交于 2020-01-09 08:05:00
问题 I wanted to use the python plugin for twitter called tweepy. in my main.py file I just imported tweepy import tweepy My setup-file looks like this: from distutils.core import setup import py2exe setup( windows=[{ "script": 'main.py', }], options={ "py2exe": { "includes": ["sip", "tweepy"] } } ) When i execute python setupy.py py2exe via command line I get this repeating codeblock until I get an RuntimeError: maximum recursion depth exceeded in comparison. File "C:\Python34\lib\site-packages

PyInstaller FrozenImporter has no attribute archive

本秂侑毒 提交于 2020-01-06 19:37:32
问题 Pyinstaller and py2exe seem to be always produce errors when trying to run. Even a simple test program that pops a blank window up fails to run. PyInstaller error: Traceback (most recent call last): File "<string>", line 1, in <module> File "c:\python27\lib\site-packages\PyInstaller-2.1-py2.7.egg\PyInstaller\loader\pyi_importers.py", line 270, in load_module exec(bytecode, module.__dict__) File "C:\Users\jammerxd\Desktop\VEXDisplayServer\build\test\out00-PYZ.pyz\wx", line 22, in <module> File

如何使Python脚本独立可执行文件在没有任何依赖的情况下运行? [关闭]

孤人 提交于 2020-01-06 15:45:47
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 我正在构建一个Python应用程序,并且不想强迫我的客户安装Python和模块。 我也想将我的应用程序设为开源。 那么,有没有办法将Python脚本编译为独立的可执行文件? #1楼 对于Python 3.2脚本,唯一的选择是Cxfreeze。 从源代码构建它,否则它将不起作用。 对于python 2.x,我建议使用pyinstaller,因为它可以将python程序打包在一个可执行文件中,这与CxFreeze一样,它也输出库。 #2楼 我还建议使用 pyinstaller 以获得更好的向后兼容性,例如python 2.3-2.7 。 对于 py2exe ,您必须具有python 2.6 #3楼 您可能希望调查 Nuitka 。 它需要python源代码并将其转换为C ++ API调用。 然后将其编译为可执行二进制文件(在Linux上为ELF)。 它已经存在了几年,并且支持多种Python版本。 如果使用它,您可能还会获得性能上的改进。 推荐的。 #4楼 使用py2exe...。使用以下设置文件: from distutils.core import setup import py2exe from distutils.filelist import findall import matplotlib setup

How to make Python API using py2exe?

我的梦境 提交于 2020-01-05 07:57:57
问题 Is it possible to "compile" a Python script with py2exe (or similar) and then allow the user access to modify the top-level Python scripts? Or possibly import the compiled modules into their normal Python scripts? I'm looking for the ability to distribute an easy installer for some customers, but allow other customers to build upon that installed version by creating their own scripts that work with the installed framework modules, like an API. I have tried to use py2exe to import files that I