4

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?

Greg Lovern
  • 958
  • 4
  • 18
  • 36
  • Modules written in C are linked to a specific version of Python. I don't know this package, but it seems that the version you have does require 3.4 because of the `py3.4` part of the filename. There is a similar question (not the same package) here: http://stackoverflow.com/questions/24676609/numpy-python-3-4-1-installation-python-3-4-not-found-in-registry. The thread you mention has a link to http://www.lfd.uci.edu/~gohlke/pythonlibs/#cx_freeze which does appear to have a 3.5 version. – cdarke May 07 '16 at 08:44
  • BTW the title of your question is misleading, you are not compiling Python you are building it from a pre-compiled binary. The difference is analogous to buying a bunch of wood to build a cabinet compared to getting a flat-pack from Ikea. – cdarke May 07 '16 at 08:53

2 Answers2

3

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

skrause
  • 989
  • 1
  • 9
  • 14
2

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.

Frikster
  • 2,755
  • 5
  • 37
  • 71
  • This information is actually incorrect. Pyinstaller only has support for Python 2.7 unfortunately. Cx_Freeze seems to be the only library that has support for Python 3.5. As well there has been no update to provide support for Python 3.6 (unless there is an unofficial fix I am not aware of) – paglynn Jan 11 '17 at 10:24
  • 1
    Um, if this is the case then their website needs to be amended? This is the the opening paragraph on Pyinstaller where it explicitly states it supports 3.3-3.5: "PyInstaller is a program that freezes (packages) Python programs into stand-alone executables, under Windows, Linux, Mac OS X, FreeBSD, Solaris and AIX. Its main advantages over similar tools are that PyInstaller works with Python 2.7 and 3.3—3.5, it builds smaller executables thanks to transparent compression, it is fully multi-platform, and use the OS support to load the dynamic libraries, thus ensuring full compatibility." – Frikster Jan 11 '17 at 23:56
  • And yea, it looks like cx_freeze supports Python 3 as well now, but from mailing lists I read I agree it would appear 3.6 support is not getting any attention. – Frikster Jan 11 '17 at 23:56
  • 1
    I use PyInstaller to build executables from Python 3.5. For me, PyInstaller has been the easiest way to build shareable .exe files. +1 for this answer. – SNygard Jan 12 '17 at 16:14