I am trying to convert a python file to JS using transcrypt using the command transcrypt -b -m -n hello.py
. I have an import to JSON in my python script:
import json
# the MAIN meaty function!!!
def exec_script_str(script_str, raw_input_lst_json, options_json, finalizer_func):
if options_json:
options = json.loads(options_json)
...
I get this error message:
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: /home/sarwagya/Desktop/Hello/target/org.transcrypt.runtime.js Saving target code in: /home/sarwagya/Desktop/Hello/target/re.translate.js Saving target code in: /home/sarwagya/Desktop/Hello/target/re.js Saving target code in: /home/sarwagya/Desktop/Hello/target/warnings.js
Error while compiling (offending file last):
File '/home/sarwagya/Desktop/Hello/hello.py', line 2186, at import of:
File '/usr/lib/python3.8/json/init.py', line 108, at import of:
File 'codecs', line 44, namely: Can't import module 'codecs'Aborted
I have a number of imports before this which seem to work. Since there is a JSON package in Javascript I would have thought transcript would support this. Thanks for the help.