keyboardlayouteditor
keyboardlayouteditor copied to clipboard
Unable to build on Mint 19.3: antlr_python_runtime - 'invalid syntax'
$ sudo -H pip install http://www.antlr3.org/download/Python/antlr_python_runtime-3.1.2.tar.gz
Collecting http://www.antlr3.org/download/Python/antlr_python_runtime-3.1.2.tar.gz
Downloading http://www.antlr3.org/download/Python/antlr_python_runtime-3.1.2.tar.gz (67kB)
|████████████████████████████████| 71kB 2.0MB/s
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-ke4jo6eg/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-ke4jo6eg/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-req-build-ke4jo6eg/pip-egg-info
cwd: /tmp/pip-req-build-ke4jo6eg/
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-req-build-ke4jo6eg/setup.py", line 49
except OSError, exc:
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I found a package in my repos called 'antlr4' so I installed that - but the java command in your instructions (even when that command was modified accordingly) - threw an error:
~/git/kbl/keyboardlayouteditor $ java -classpath antlr-4.jar org.antlr.Tool *.g
Error: Could not find or load main class org.antlr.Tool
Cf. #2.
Your pip
is finding its way to a Python 3 pip
, and it's erroring out on Python 2 syntax that it doesn't understand. Try pip2
(which should be available if you've done sudo apt-get install python-pip
)
Since the instructions already have Debianisms perhaps they should say pip2
Using pip2 instead of pip worked for me. Please update the documentation!
Use command :
java -classpath antlr-4.jar org.antlr.Tool Keycodes.g KeycodesWalker.g XKBGrammar.g XKBGrammarWalker.g
and launch program : python2 ./KeyboardLayoutEditor
PS: System manjaro