0

Short version: Is it possible to create a standalone program that can be distributed to computers that don't have python installed, which writes a python script during runtime and executes it during or shortly after?

Long version: A project I've been wanting to do for a while is to create a visual programming interface, that lets people use Machine Learning without needing to know python/keras/numpy syntax. Programs like lobe or rapidminer already do this, but they are all bound to their own interfaces and servers. What i would like to do is create a program that:

  • anyone can use without needing python/anaconda installed
  • allow the user to create visual scripts like in scratch or google-blocs
  • generates python code behind the scenes containing keras or tf code
  • is able to execute the script
  • is able to show the code to the user for:
    • educational purposes
    • allowing the user to use it as a base for a more complex program

Since the generation part would just need to create a text file almost any interface and language like python/java using Qt or C# / javascript using Unity, would qualify. I think that should definitely be doable, probably just very long, but that is not my largest concern.

The problem: I have tried to search everywhere on the internet about things like standalone python programs which led me to for instance py2exe. Those kind of python-to-exe's work great, but they all require the script to be compiled on a machine containing a python environment. In my case i want to be able to generate a python script on the user's PC, and run it directly after from there.

The alternative

If this isn't possible i might just create the whole AI part myself, not using python nor libraries like keras or tensorflow, but in a unity game for instance. The downside to this would be that it exists already(like rapidminer), it would be less optimized/versatile/customizable and doesn't show what the "real" machine learning script would look.

If there are any other alternatives i would be happy to hear them

PS.

I have mostly Python & Keras, moderate Java and little Unity3D or web JS experience

I'm using Windows with anaconda

Distributing to linux/mac would be nice, but not required

  • You could bundle a static python version into your standalone program. – Woohoojin Feb 22 '19 at 15:36
  • `py2exe` and friends package the Python interpreter, together with the needed subset of the libraries *that are installed on your computer* to do what they do. It follows that it has to be done on a machine where those libraries are installed. What you want isn't much different from wanting to make it possible to compile a program from source on the user machine, without the source being on the user machine. – BoarGules Feb 22 '19 at 15:37
  • @BoarGules so if i understand correctly, I would have to incorporate those libraries and python inside some folder of my distribution. In order for the user machine to be able to execute the python script(now i'm writing this it sounds so plain and logical), as Christian Scilitoe said. Can I include modules like Keras without the user having to manually set up an environment or is that a requirement? – Emiel Witting Feb 22 '19 at 15:54
  • @EmielWitting There is no need to set up an environment as long as your `.exe` contains everything it needs. Getting that right with complicated libraries like `keras` (which brings `numpy` and `scipy` etc with it) may turn out to be a little easier said than done. – BoarGules Feb 22 '19 at 16:03
  • @BoarGules I know you can bundle all those libraries into your .exe, but with all the things like py2exe, the .exe has to be created on a machine with a python environment. But in my case the .py is only generated on the user's machine. So i guess I will just need to embed a python interpreter and the libraries in my program/project, right? – Emiel Witting Feb 22 '19 at 17:04
  • Well, the Python interpreter will be in the package already. Otherwise there would be a way to run the modules in the package. – BoarGules Feb 22 '19 at 17:06

2 Answers2

1

maybe you should check the Orange Data Mining software, it's written in python and it has the same purpose as your project (https://orange.biolab.si/). On the other hand, some time ago I tried to compile my app that contains machine learning libraries but to date, I have not been able to achieve it. Instead, what I use is the WINPYTHON project, this is a portable Anaconda software that allows you to run projects on any PC without the need to install anything (https://winpython.github.io/).

vijolica
  • 358
  • 1
  • 9
Science Man
  • 39
  • 1
  • 8
0

Yes, it is possible!

I had the same requirement, so I wrote my visual programming language and IDE...

NodeCode in Ai-Board

...that could generate an almost python-like script, and which is compiled natively inside the app, without the use of any external compilers or libraries.

enter image description here

My target architecture was mobile devices, but it also works on browsers via the unity plugin. ...and yes, that's correct, it runs natively on your phone or tablet in a simulated sandbox, with its own built-in IDE.

It's written in C#, and implemented in Unity3d

You can check it out at https://aiBoard.blog ..and see the videos at https://youtu.be/DIDgu9jrdLc

olonge
  • 1,161
  • 10
  • 8