java2python
java2python copied to clipboard
ERROR: No matching distribution found for antlr_python_runtime==3.1.3 (from java2python==0.5.1)
I'm having trouble installing Java2python. I'm currently using Python version 3.8.2. I'm pretty new to python so I'm not too sure what to do.
It does not work for python 3. Try using python 2
I tried in python 2.7 and had the same error
ERROR: Could not find a version that satisfies the requirement antlr_python_runtime==3.1.3 (from java2python->-r /requirements.txt (line 1)) (from versions: none)
ERROR: No matching distribution found for antlr_python_runtime==3.1.3 (from java2python->-r /requirements.txt (line 1))
A workaround:
pip install http://www.antlr3.org/download/Python/antlr_python_runtime-3.1.3.tar.gz
pip install java2python
A workaround:
pip install http://www.antlr3.org/download/Python/antlr_python_runtime-3.1.3.tar.gz pip install java2python
A workaround:
pip install http://www.antlr3.org/download/Python/antlr_python_runtime-3.1.3.tar.gz pip install java2python
iam getting error
Collecting http://www.antlr3.org/download/Python/antlr_python_runtime-3.1.3.tar.gz
Using cached http://www.antlr3.org/download/Python/antlr_python_runtime-3.1.3.tar.gz (76 kB)
ERROR: Command errored out with exit status 1:
command: /data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/data/data/ru.iiec.pydroid3/cache/pip-req-build-vujya2hq/setup.py'"'"'; file='"'"'/data/data/ru.iiec.pydroid3/cache/pip-req-build-vujya2hq/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 /data/data/ru.iiec.pydroid3/cache/pip-pip-egg-info-7_nun68w
cwd: /data/data/ru.iiec.pydroid3/cache/pip-req-build-vujya2hq/
Complete output (6 lines):
Traceback (most recent call last):
File "
Any updates?
I'm getting the same error when attempting to install antlr_python_runtime-3.1.3.tar.gz
.:
$ pip install http://www.antlr3.org/download/Python/antlr_python_runtime-3.1.3.tar.gz
Collecting http://www.antlr3.org/download/Python/antlr_python_runtime-3.1.3.tar.gz
Downloading http://www.antlr3.org/download/Python/antlr_python_runtime-3.1.3.tar.gz (76 kB)
|████████████████████████████████| 76 kB 936 kB/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-3xazd193/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-3xazd193/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-3xazd193/pip-egg-info
cwd: /tmp/pip-req-build-3xazd193/
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-req-build-3xazd193/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'm not well versed in the nuances of Python versions, but it looks like (in my case) Python 2.7.18 doesn't like the syntax of except OSError, exc:
in the antlr_python_runtime v3.1.3. This was valid syntax prior to python 2.6. Most of us are on to 2.7 now. The solution is going to be either downgrading to Python < 2.6 (Untested) or changing the requirement of java2python to use a version of Antlr Python Runtime that supports Python 2.7. Antlr3 v3.1.3 is the latest as of writing, and it looks like the Antlr team moved on to v4. The major version change makes me wonder if there will be breaking changes, but that has yet to be confirmed.
I think the path forward is to use / port to the antlr4-python2-runtime
dependency.
Better yet, support Python3 and make use of the antlr4-python3-runtime
dependency.
For a "quick fix" install Python < 2.6.