FraBle / python-sutime

Python wrapper for Stanford CoreNLP's SUTime
GNU General Public License v3.0
153 stars 43 forks source link

RuntimeError: Not all necessary Java dependencies have been downloaded! #41

Open CarlosAlbertoN opened 4 years ago

CarlosAlbertoN commented 4 years ago

Hello!

So, i'm trying to run python-sutime but i keep getting this error:

"RuntimeError: Not all necessary Java dependencies have been downloaded!"

The picture below are from my files after i had installed with maven:

image

Im using:

Utkichaps commented 4 years ago

In the source code for your sutime i.e. sutime.py, you have to change the versions of the jar files used. So you have to take care of these two files: 1 In your source sutime.py, make sure the jar versions listed here are the same as the jar versions you have downloaded.
2 If it isn't, the best thing you can do is copy the sutime.py file from this repo and replace your source sutime.py file with it.

And also make sure that in your jars folder you have this version:
3

carlosalbertonascimento commented 4 years ago

Thank you for the feedback!

So, i have made the changes that you said but it's not running.

image

image

Utkichaps commented 4 years ago

Aaah yes in your source sutime.py the last few lines of code are this:

        return json.loads(self._sutime.annotate(input_str, reference_date))
    return json.loads(self._sutime.annotate(input_str)) 

Change it to:

        return json.loads(str(self._sutime.annotate(input_str, reference_date)))
    return json.loads(str(self._sutime.annotate(input_str)))

The Java wrapper basically returns a java.lang.String. We have to convert that to a python str.

Also it might be better to keep this issue open till the developers fix it, so that anyone else having the same issue will be able to apply this fix.

carlosalbertonascimento commented 4 years ago

@Utkichaps thank you! Now it's running. I'll keep the issue open.

Feyorn commented 4 years ago

I am getting the same error. However I feel there might be some error with my steps so I'll mention them

However I am still getting the error mentioned above of not all necessary Java dependencies have been downloaded

Please let me know if someone can help

CarlosAlbertoN commented 4 years ago

Hello, @Feyorn so i had a lot of problems trying to run as well and at the end i have a code running (finally).

I have made a google colab with all the steps to make it run.

Here it is: https://colab.research.google.com/drive/1p0Y-9pnM60zHbURUyO7hJOJ72IKY5nKx?usp=sharing

Let me know if you have any questions.

Feyorn commented 4 years ago

Hey @CarlosAlbertoN , thank you for responding. I am still getting the same error, I am however listing the steps I followed in my Windows system:

However the error still persists. Thank you for your file, it was properly detailed. However if you can let me know if you find what error exists in my approach, that would be great. Thank you

CarlosAlbertoN commented 4 years ago

Try to open a new terminal and execute again the code:

import os
import json
from sutime import SUTime
if name == 'main':
test_case = u'I need a desk for tomorrow from 2pm to 3pm'

jar_files = os.path.join(os.path.dirname(D:\python-sutime-master\sutime\jars'), 'jars')
sutime = SUTime(jars=jar_files, mark_time_ranges=True)

print(json.dumps(sutime.parse(test_case), sort_keys=True, indent=4))
Feyorn commented 4 years ago

@CarlosAlbertoN yeah, I tried that but the error didn't change

CarlosAlbertoN commented 4 years ago

I see. I didn't try to run in windows, so maybe i'm missing a step that i didn't face. So, take a better look, maybe do the steps again. Or you can try to use with google colab instead.

Utkichaps commented 4 years ago

42

FraBle commented 4 years ago

Hey everyone, I'm sorry that you folks run into these issues. I've never expected that my little project gets so much traction after publishing it on GitHub.

My life kept me very busy, but I have vacation planned for later this month and plan to spend some time addressing this issue as well as the other ones filed against this project.

ajay9022 commented 4 years ago

Hello, @Feyorn so i had a lot of problems trying to run as well and at the end i have a code running (finally).

I have made a google colab with all the steps to make it run.

Here it is: https://colab.research.google.com/drive/1p0Y-9pnM60zHbURUyO7hJOJ72IKY5nKx?usp=sharing

Let me know if you have any questions.

@CarlosAlbertoN @FraBle @Utkichaps I downloaded and ran your notebook on my colab but it's throwing the same error as: RuntimeError: Not all necessary Java dependencies have been downloaded!

Can you check what's going wrong?

Also, do we need to update the sutime.py and use str as described in the above comments?