Generate and execute python both on non-python machine

592 views Asked by At

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

2

There are 2 answers

0
Science Man On

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/).

0
olonge On

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