I'm helping my 10yo go through the book "Python for Kids" by Jason Briggs, on Windows 7. He already knows Scratch. He's making great progress in the book, but I'm surprised that it has no information about creating an exe; it assumes Python will be installed on any computer the kids' programs run on. That isn't going to work when the kid wants to give his programs to his friends. Helping him with this book is my own first exposure to Python.
Google led me to cx_Freeze 4.3.4, but when I try to install it (cx_Freeze-4.3.4.win32-py3.4.exe), I get the message:
"Python version 3.4 required, which was not found in the registry."
Does that mean I have to downgrade to Python 3.4? But then I found this thread which seems to indicate that cx_Freeze should work on Python 3.5:
https://sourceforge.net/p/cx-freeze/mailman/message/34695906/
What do I need to do?
cx_Freeze 4.3.4 doesn't work with Python 3.5. However, the development version of cx_Freeze 5.0 is reasonably stable, but since there is still no official release yet, I could not find any easily usable distribution for Windows. So I've created a simple GitHub page with some instructions and pre-built binary Python Wheels for anyone who needs to create an exe distribution with Python 3.5 on Windows: https://github.com/sekrause/cx_Freeze-Wheels
Last I checked Pyinstaller has official support (think it's the only one thus far?) for Python 3.5
Here's a friendly tutorial on how to make an .exe using Pyinstaller. His steps works for me for simple 3.5 applications which might be all you need it for. The youtuber in the link also has a very well-covered playlist for python GUI development which was my first exposure to python GUI development.
Related
We used to distribute (for Windows) a very large Python 2/PyGTK application by packaging Python installer itself along other needed installers and packages through an InnoSetup script. Among with those other installers and packages we deliver an all-in-one PyGTK package and it worked very well.
Now we've converted our software for Python 3 and GTK 3. Ok, there is an all-in-one for PyGI [1] (PyGObject Introspection), but just for Python 2.7 to 3.4 and we need at least Python 3.7.
I've spent last couple of weeks learning MSYS2 and trying to understand how MyPaint or Gaphor (which are similar apps) are distributed for Windows without success. I am able to download and install GTK and PyGI using pacman on MSYS2/MingW64 but I cannot figure out how can I create such a package like PyGI all-in-one. I asked for help or instructions on SourceForge but I got no responses so far.
I am asking for help or any clues on how can I generate a PyGI-all-in-one-like installer. Thanks in advance!
[1] https://sourceforge.net/projects/pygobjectwin32/
You can bundle a PyGObject app in Windows using PyInstaller. It can be used with either MSYS2 or gvsbuild to find and bundle all the GTK libraries you need. Then you can use your InnoSetup script to create an installer.
Can someone please provide a 'for dummies' list of instructions to install openCV 3.x for use with Python 3.x on Windows 10?
A Hello-World of sorts? The OpenCV site doesn't appear to have one.
I am happy to use whatever IDE but as I have used Sublime Text 2 I would prefer to keep doing so.
I have spent quite a bit of time developing a reasonably complex and succesful C++ 2.x openCV application in Visual Studio and managed (with some effort) to get that development environment working for me, but when it comes to cmake/builds/github/source/compilers and all the configurations required for Python I am facing too many free variables and unknowns (and my own ignorance regarding these things).
In all the tutorials, SE Q&A and other internet dialog I've discovered there is jargon heavy and includes missed steps and assumed knowledge.
Potentially irrelevant info (??) follows:
OpenCV for Python 3.x under Windows looks good, but cmake is complaining:
"CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles". CMAKE_MAKE_PROGRAM is not set."
Which is probably something to do with my selection of 'Sublime Text 2 - minGW' in 'configure'. Maybe not, no idea, the answer given doesn't suggest which option I'm meant to chose and why...
I very recently wrote a program for a friend where it simplifies some important daily calculations for him/her. Now, the problem I am having is that I want to compile the code into an executable program so that he/she can comfortably run it on their machine, perhaps with a simple graphical interface or whatnot.
I have tried using cx_Freeze with Python 3.3.0 64 bit but to no avail (the program simply refuses to start on their machine; I even tried generating an executable via 32-bit Python, but also to no avail). What I then thought was that I could perhaps generate an executable program via PyGame? But the fact of the matter is that I have never used any Python-related program except the IDLE, so I am not sure what to do and look for.
Another option would perhaps be to convert the Python 3.3.0 code to Python 2.x, but the problem is that I am not familiar with Python 2.x and neither is there any automated converter available (as far as I know). I was wondering whether anyone of you could direct me to any good sources/links, since those I have been ferociously Googling are rather inconcrete.
You could just use py2exe. It is compatible with python 3. I have seen tutorials for it on youtube.
You could try embedding it in a C program, and compiling that for your executable. A decent tutorial is in the python docs at http://docs.python.org/2/extending/embedding.html
PyInstaller "is a program that converts (packages) Python programs into stand-alone executables, under Windows, Linux, Mac OS X, Solaris and AIX" and gives you one standalone executable file.
Even as a noob Python user I have succeeded to pack my app using PyInstaller (relatively) easily.
On the web, I can find various example on gimp scripting with python.
http://www.jamesh.id.au/software/pygimp/
http://www.gimp.org/docs/python/pygimp.html
We need to import the gimpfu module to get the examples to work. Where can we get the installer of PyGIMP on Windows? It seems the project is dead and the links are broken.
In order to develop Gimp scripts using Python-fu I have followed gimp users article, In short you need to download & install the following:
Python 32-bit from here.
All in one 32-bit from here.
Gimp 2.6 32-bit from here.
Then you need to create your-plugin.py file in C:\Users\MyUsername.gimp-2.6\plug-ins
P.S: Restart your gimp after adding code or modifying your register() function in order to take effect each time.
PyGIMP is part of GIMP (GNU Image Manipulation Program) and can only work in together with it. For Linux distributions it is often found in a different package - but its code lies inside the GIMP code source, and on Windows it is installed alongside GIMP.
As far as I know, the GIMP 2.8 installer for Windows should come with all dependencies (Python interpreter included) for it to work - else all you need to do is to have the dependencies for it to work installed before installing GIMP.
These should be:
Python 2.5, 2.6 or 2.7
Python-gtk
Pycairo
And finally GIMP itself.
Them, you can't just use pygimp as a standalone Python module - it has to be launched from within GIMP to be able to use the program libraries and code. It is relatively easy to create a script that would respond to xmlrpc or similar method, to stay quietly running awaiting requisitions from external scripts to process images with GIMP, tough.
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
Did you check out cx_Freeze? It seems to create standalone executables from your Python scripts, including support for Python 3.0 and 3.1
py2exe for Python3 is out!
Here is the original bug report:
http://sourceforge.net/projects/py2exe/
Here is the comment mentioning the release:
http://sourceforge.net/projects/py2exe/
Here is the package on pypi:
https://pypi.python.org/pypi/py2exe/0.9.2.0
Note that py2exe for Python 3 only supports Python 3.3 and above!
A huge thank you to the py2exe development team!
The py2exe and 2to3 programs serve completely different purposes, so I'm not sure what your ultimate goal is.
If you want to build an executable from a working Python program, use the version of py2exe that is suitable for whichever Python you are using (version 2 or version 3).
If you want to convert an existing Python 2 program to Python 3, use 2to3 plus any additional editing as necessary. The Python 3 documentation describes the conversion process in more detail.
Update: I now understand that you might have been trying to run 2to3 against py2exe itself to try to make a Python 3 compatible version. Unfortunately, this is definitely beyond the capabilities of 2to3. You will probably have to wait for the py2exe project to release a Python 3 compatible version.
If you have easy setup installed, type pip install py2exe in a shell to install.