py2exe

build a .exe for Windows from a python 3 script

六眼飞鱼酱① 提交于 2019-11-26 17:21:41
问题 I would like building an executable for a python 3 script that: imports pyqtgraph (with pyqt5) imports theano and pymc3 also imports numpy, scipy, sys, os opens a simple GUI made with qt designer and stored in a ‘.ui' file will be distributed on machines with Windows 7+ I tried several tools (py2exe, pyinstaller, pynsist, cx_Freeze) during hours but failed each time. my 'less worse’ result was with pyinstaller (see below) without theano part (and so without a part of the script). Can anyone

how can i get the executable's current directory in py2exe?

非 Y 不嫁゛ 提交于 2019-11-26 16:33:12
I use this bit of code in my script to pinpoint, in a cross-platform way, where exactly it's being run from: SCRIPT_ROOT = os.path.dirname(os.path.realpath(__file__)) Pretty simple. I then go on to use SCRIPT_ROOT in other areas of my script to make sure everything is properly relative. My problem occurs when I run it through py2exe, because the generated executable doesn't set __file__ , therefore my script breaks. Does anyone know how to fix or work around this? Here is the py2exe documentation reference and here are the relevant items: sys.executable is set to the full pathname of the exe

Python - IndexError: tuple index out of range when using py2exe

一个人想着一个人 提交于 2019-11-26 16:10:39
I'm currently trying to make an executable using py2exe. I use Python 3.6. The script I'm using imports openpyxl and pptx and runs fine when I use Pycharm or run the script using the command window. The output produces the error: IndexError: tuple index out of range Below you can find the cmd output: C:\Python36>python setup.py py2exe running py2exe Traceback (most recent call last): File "setup.py", line 4, in <module> setup(console=['Storybookmaker.py']) File "C:\Python36\lib\distutils\core.py", line 148, in setup dist.run_commands() File "C:\Python36\lib\distutils\dist.py", line 955, in run

How to call python script on excel vba?

家住魔仙堡 提交于 2019-11-26 15:16:42
trying to call a python script on Vba and I am a newb. I tried converting the main script to an exe using py2exe and then calling it from VBA (shell) but the main script calls other scripts therefore it becomes complicated and I messed it up (my exe is not functional). Besides, the the main script is a large file and I do not want to revise it a lot. Bottomline, is there a way to call the main script from excel vba, without converting the script to an exe file. So far, I tried: RetVal = Shell("C:\python27\python.exe " & "import " & "C:\\" & "MainScriptFile") It starts python.exe but does

Py2exe for Python 3.0

£可爱£侵袭症+ 提交于 2019-11-26 13:40:12
I am looking for a Python3.0 version of "py2exe". I tried running 2to3 on the source for py2exe but the code remained broken. Any ideas? Update 2014-05-15 py2exe for Python 3.x is now released! Get it on PyPI . Old information Have a look at the py2exe SourceForge project SVN repository at: http://py2exe.svn.sourceforge.net/ The last I looked at it, it said the last update was August 2009. But keep an eye on that to see if there's any Python 3 work in-progress. I've also submitted two feature requests on the py2exe tracker. So far, no feedback on them: Support Python 3.x Project roadmap Titusz

Process to convert simple Python script into Windows executable [duplicate]

北慕城南 提交于 2019-11-26 12:42:11
This question already has an answer here: Create a single executable from a Python project 2 answers I wrote a script that will help a Windows user in her daily life. I want to simply send her the .exe and not ask her to install python, dlls or have to deal with any additional files. I've read plenty of the stackoverflow entries regarding compiling Python scripts into executable files. I am a bit confused as there are many options but some seem dated (no updates since 2008) and none were simple enough for me not to be asking this right now after a few hours spent on this. I'm hoping there's a

making exe file from python that uses command line arguments

陌路散爱 提交于 2019-11-26 11:32:47
问题 I want to create an exe from a python script that uses command line arguments (argv) From what I\'ve seen py2exe doesn\'t support command-line-arguments What can I do? EDIT: I was using a GUI2Exe tool, so I just missed the Console flag, but the accepted answer is perfectly correct 回答1: setup(console=['hello.py']) I believe the line you want to use looks like this. I tested this with 2 files: hello.py import sys for arg in sys.argv: print arg print "Hello World!" And setup.py from distutils

Hiding console window of Python GUI app with py2exe

删除回忆录丶 提交于 2019-11-26 11:10:19
问题 I have a Python program uses Qt (PyQt4 in fact) and when I launch it from its main.py, I get a console window and the GUI window (on Windows, of course). Then I compile my program with py2exe and main.exe is successfully created. However, if I run main.exe (this is what users of program will do) console window of Python still appears and all my debug text is stdout-ed to that window. I want to hide cmd line window when my application is running and I want just my GUI to be visible to the user

Are there any alternatives to py2exe? [closed]

拥有回忆 提交于 2019-11-26 10:14:56
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 6 years ago . Are there any alternatives to py2exe? 回答1: cx_Freeze is cross-platform and does the same, or you could use py2app, which works on mac only. 回答2: pyInstaller is cross-platform and very powerful, with many third-party packages (matplotlib, numpy, PyQT4, ...) specially supported "out

how can i get the executable&#39;s current directory in py2exe?

懵懂的女人 提交于 2019-11-26 04:49:28
问题 I use this bit of code in my script to pinpoint, in a cross-platform way, where exactly it\'s being run from: SCRIPT_ROOT = os.path.dirname(os.path.realpath(__file__)) Pretty simple. I then go on to use SCRIPT_ROOT in other areas of my script to make sure everything is properly relative. My problem occurs when I run it through py2exe, because the generated executable doesn\'t set __file__ , therefore my script breaks. Does anyone know how to fix or work around this? 回答1: Here is the py2exe