Skip to content

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

Description

@CarlosAlbertoN

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"

Activity

  1. Utkichaps commented on Jul 28, 2020

    @Utkichaps

    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

  2. carlosalbertonascimento commented on Jul 29, 2020

    @carlosalbertonascimento

    Thank you for the feedback!

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

    image

    image

  3. Utkichaps commented on Jul 29, 2020

    @Utkichaps

    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.

  4. carlosalbertonascimento commented on Jul 29, 2020

    @carlosalbertonascimento

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

  5. Feyorn commented on Aug 5, 2020

    @Feyorn

    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

  6. CarlosAlbertoN commented on Aug 5, 2020

    @CarlosAlbertoN
    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.

  7. Feyorn commented on Aug 5, 2020

    @Feyorn

    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

  8. CarlosAlbertoN commented on Aug 5, 2020

    @CarlosAlbertoN
    Author

    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))
    
  9. Feyorn commented on Aug 5, 2020

    @Feyorn

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

  10. CarlosAlbertoN commented on Aug 5, 2020

    @CarlosAlbertoN
    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.

  11. Utkichaps commented on Aug 6, 2020

    @Utkichaps
  12. FraBle commented on Aug 6, 2020

    @FraBle
    Owner

    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.

  13. ajay9022 commented on Oct 5, 2020

    @ajay9022

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions