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

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

Open
CarlosAlbertoN opened this issue Jul 24, 2020 · 13 comments

Comments

@CarlosAlbertoN
Copy link

CarlosAlbertoN commented Jul 24, 2020

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:

  • Python 3.6.9 and running in Google Colab
  • Apache Maven 3.6.0
  • Maven home: /usr/share/maven
  • Java version: 11.0.7, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
  • Default locale: en_US, platform encoding: UTF-8
  • OS name: "linux", version: "4.19.104+", arch: "amd64", family: "unix"
@Utkichaps
Copy link

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

Thank you for the feedback!

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

image

image

@Utkichaps
Copy link

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

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

@Feyorn
Copy link

Feyorn commented Aug 5, 2020

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

  • I have Python, Java, Maven installed and ready

  • I have created a new .py file. It is currently on my desktop where I have copied the following 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))

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
Copy link
Author

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
Copy link

Feyorn commented Aug 5, 2020

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:

  • Removed the pip intsalled sutime

  • From the git repo, copied the pom.xml to the folder called sutime within python-sutime.

  • Copied the new sutime folder containing jars, pom.xml, test, init and sutime.py to the collection of my python libraries

  • Using command prompt at the location of the new sutime file, I ran mvn dependency:copy-dependencies -DoutputDirectory=./jars -P english which was over 1GB of download.

  • Once done, I ran the code where I replaced the file with the path of the sutime packaged file.

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
Copy link
Author

CarlosAlbertoN commented Aug 5, 2020

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
Copy link

Feyorn commented Aug 5, 2020

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

@CarlosAlbertoN
Copy link
Author

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
Copy link

#42

@FraBle
Copy link
Owner

FraBle commented Aug 6, 2020

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
Copy link

ajay9022 commented Oct 5, 2020

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?

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

6 participants