Transcrypt
Transcrypt copied to clipboard
Transcrypt compilation error Python 3.7 Windows
I just tried the latest transcrypt on Python 3.7 Win7 with the simple program from https://github.com/bunkahle/Transcrypt-Examples/blob/master/alerts/alerts2.py but I got an compilation error:
transcrypt alerts2.py
Transcrypt (TM) Python to JavaScript Small Sane Subset Transpiler Version 3.7.16
Copyright (C) Geatec Engineering. License: Apache 2.0
Saving target code in: C:/Python37/Programme/Transcrypt/target/org.transcrypt.runtime.js Saving minified target code in: C:/Python37/Programme/Transcrypt/target/org.transcrypt.runtime.js
Error while compiling (offending file last): File 'org.transcrypt.runtime', line 0, namely:
[WinError 2] The system cannot find the specified file
I finally found out myself what went wrong. In case you get that error most probably Java is not installed on your machine which is needed to minify the javascript code which transcrypt seems to try by default. So just invoke the command:
transcrypt -n alerts2.py
and it runs without any error because -n disables minification of the code. BTW it would be nice if transcrypt would output an error message like "Warning: No Java installed - minification is disabled. Install Java for code minification." or the like and still output the not minified code. Or even better not rely on Java at all for code minification. Should be a three liner in Python I think.
Is Transcrypt really usable, when an prio1-issue dont is worked on over an year ?
@tcs-ulli the short answer is yes, it is. I've been using it over the past year to create React/Material-UI apps without having to write any JavaScript code, just Python. It has been a game changer for me in terms of being able to create front-end applications with Python.
The code base was stagnant for a while, but the maintainer has committed to continued support and was back to working on it as of this past November. I don't want to necessarily speak for them, but their next goal was to get it working with Python 3.8/3.9 and then start tackling these other issues. There are actually many prio1 issues in queue so I imagine it will take some time to work through them all. Some (like this one) are perhaps more of an annoyance than a blocker since there are workarounds.