sap218 / jabberwocky

NLP toolkit for those nonsensical ontologies
https://sap218.github.io/jabberwocky/
MIT License
16 stars 1 forks source link

missing dependency? #10

Closed balhoff closed 4 years ago

balhoff commented 4 years ago

I installed jabberwocky and tried to run the first example from jabberwocky-tests. I got this output:

(pyenv) localhost:catch jim (master)$ catch --ontology ../ontology/pocketmonsters.owl --keywords listofwords.txt --textfile blogs_formatted.json --parameter blog_post > catch_output.txt
Traceback (most recent call last):
  File "/Users/jim/Documents/Reviews/JOSS/pyenv/bin/catch", line 11, in <module>
    load_entry_point('jabberwocky==0.5.0.1', 'console_scripts', 'catch')()
  File "/Users/jim/Documents/Reviews/JOSS/pyenv/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/Users/jim/Documents/Reviews/JOSS/pyenv/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/Users/jim/Documents/Reviews/JOSS/pyenv/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/jim/Documents/Reviews/JOSS/pyenv/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/Users/jim/Documents/Reviews/JOSS/pyenv/lib/python3.7/site-packages/jabberwocky-0.5.0.1-py3.7.egg/catch/catch.py", line 426, in main
    search_term_dictionary = ontologyPurl(ontology, keywords)
  File "/Users/jim/Documents/Reviews/JOSS/pyenv/lib/python3.7/site-packages/jabberwocky-0.5.0.1-py3.7.egg/catch/catch.py", line 77, in ontologyPurl
    souped = souping(ontology) # Reading in the ontology file
  File "/Users/jim/Documents/Reviews/JOSS/pyenv/lib/python3.7/site-packages/jabberwocky-0.5.0.1-py3.7.egg/catch/catch.py", line 25, in souping
    soup = BeautifulSoup(contents,'xml')
  File "/Users/jim/Documents/Reviews/JOSS/pyenv/lib/python3.7/site-packages/bs4/__init__.py", line 228, in __init__
    % ",".join(features))
bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?

I'm running in a virtual environment with only the jabberwocky dependencies installed.

(this is part of JOSS review https://github.com/openjournals/joss-reviews/issues/2168)

sap218 commented 4 years ago

@balhoff did you run this in the your local/cloned 'jabberwocky-tests' directory?

sap218 commented 4 years ago

it may be an issue with the 'jabberwocky-tests' repo documentation but the idea is that $ catch --ontology ../ontology/pocketmonsters.owl --keywords ............. your -ontology file should direct where you clone the directory, e.g. --ontology /home/samantha/git-clones/jabberwocky-tests/ontology/pocketmonsters.owl

and so on for the other files: the repo has the files, and you direct to them in the CLI:

$ catch --ontology /home/samantha/git-clones/jabberwocky-tests/ontology/pocketmonsters.owl --keywords /home/samantha/git-clones/jabberwocky-tests/ontology/listofwords.txt --textfile /home/samantha/git-clones/jabberwocky-tests/ontology/blogs_formatted.json --parameter blog_post > catch_output.txt

balhoff commented 4 years ago

Thanks @sap218—I am running in the 'jabberwocky-tests/catch' directory. The command line does seem to point to the right folders. If the paths are wrong, I get a different error about 'No such file', which makes sense.

I installed jabberwocky by first making a virtual environment: python3 -m venv pyenv; source ./pyenv/bin/activate. Then I installed all the packages using that python environment.

sap218 commented 4 years ago

Thanks @balhoff - really sorry about that! It seems I did forget about a dependency! I've just updated the requirements.txt and README. you may need to re-clone.

I'm going to close this issue, but please reopen an issue if you find another issue!