java2python icon indicating copy to clipboard operation
java2python copied to clipboard

ANTLR 3.1.3 not found

Open smsaladi opened this issue 8 years ago • 6 comments

When trying to install with

pip install java2python

I get the following error message:

(py27)➜ Downloads pip install java2python Collecting java2python Using cached java2python-0.5.0.tar.gz Collecting antlr-python-runtime==3.1.3 (from java2python) Could not find a version that satisfies the requirement antlr-python-runtime==3.1.3 (from java2python) (from versions: ) No matching distribution found for antlr-python-runtime==3.1.3 (from java2python)

I think the installation instructions might need updating to reflect that the section Install ANTLR Runtime is necessary regardless of whether pip install java2python is used or not.

smsaladi avatar May 10 '16 07:05 smsaladi

I can make the change and submit a PR if you agree.

smsaladi avatar May 10 '16 07:05 smsaladi

@smsaladi it looks like the installs will work when using the following commands:

pip install http://antlr3.org/download/Python/antlr_python_runtime-3.1.3.tar.gz
pip install https://github.com/downloads/natural/java2python/java2python-0.5.1.tar.gz

I am using python 2.7.11 though. Not sure if this will help if you add the antlr url into the setup file.

mdaffern avatar Jun 02 '16 15:06 mdaffern

I had the same problem. Installing those two packages. the error is gone during the setup.

But then I receive this error while processing specific .java files:

  File "/home/yucer/.virtualenvs/j2p/local/lib/python2.7/site-packages/java2python/mod/basic.py", line 151, in getSyncHelpersSrc
    from java2python.mod.include import sync
ImportError: No module named include

It results that the include folder is newer than that version.

How can we overcome that error?

yucer avatar Sep 26 '16 23:09 yucer

I did solve the problem installing the last version:

> mkvirtualenv j2p
> pip install http://antlr3.org/download/Python/antlr_python_runtime-3.1.3.tar.gz
> git clone https://github.com/natural/java2python.git
> pip install -e java2python

and then using the j2p virtualenv for running it:

> workon j2p
> cd java/code/folder
> j2py myFile.java

yucer avatar Sep 26 '16 23:09 yucer

python j2py \Mac\Home\Downloads\MonkeyCreateScript-master\MonkeyCreateScript\src\com\jikexueyuan\EventModel.java python: can't open file 'j2py': [Errno 2] No such file or directory

jiangwuyue avatar Nov 13 '20 10:11 jiangwuyue

python j2py \Mac\Home\Downloads\MonkeyCreateScript-master\MonkeyCreateScript\src\com\jikexueyuan\EventModel.java python: can't open file 'j2py': [Errno 2] No such file or directory

try to remove python from the command line. Or use python -m to run it instead of python-

yucer avatar Nov 14 '20 15:11 yucer