bjascob / amrlib

A python library that makes AMR parsing, generation and visualization simple.
MIT License
216 stars 33 forks source link

The package fails to find the models? #23

Closed knsamsdesk closed 2 years ago

knsamsdesk commented 2 years ago

Hello there!

I am on a M1 Mac (2020) and have python3, spacy and amrlib all installed through Homebrew.

LocalUser@LocalMac ~ % python3
Python 3.9.6 (default, Jun 28 2021, 19:24:41) 
[Clang 12.0.5 (clang-1205.0.22.9)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import amrlib
>>> stog = amrlib.load_stog_model()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/homebrew/lib/python3.9/site-packages/amrlib/__init__.py", line 35, in load_stog_model
    stog_model = load_inference_model(model_dir, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/amrlib/models/model_factory.py", line 46, in load_inference_model
    raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), model_directory)
FileNotFoundError: [Errno 2] No such file or directory: '/opt/homebrew/lib/python3.9/site-packages/amrlib/data/model_stog'

Examining a little bit indicates decisively that the directory /opt/homebrew/lib/python3.9/site-packages/amrlib/ does not have a folder named data. Here's some sort of proof that python3 is the right one:

LocalUser@LocalMac ~ % which python3                                       
/opt/homebrew/bin/python3

I'd appreciate your help!

bjascob commented 2 years ago

Did you install the models there there or somewhere else? If you installed them elsewhere, set a link from that location to where you installed them. See https://amrlib.readthedocs.io/en/latest/install.html#install-the-models

knsamsdesk commented 2 years ago

RTFM works, what do ya know! I am truly sorry and thank you for your help!