Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build on Mint 19.3: antlr_python_runtime - 'invalid syntax' #32

Open
LinuxOnTheDesktop opened this issue Jan 6, 2020 · 4 comments

Comments

@LinuxOnTheDesktop
Copy link

$ 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.

@rakslice
Copy link

rakslice commented Jan 9, 2020

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)

@rakslice
Copy link

rakslice commented Jan 9, 2020

Since the instructions already have Debianisms perhaps they should say pip2

@qole
Copy link

qole commented Feb 13, 2020

Using pip2 instead of pip worked for me. Please update the documentation!

@Dev-Crea
Copy link

Dev-Crea commented Jun 1, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants