Stuck on Installing Link Grammar - Crostini Debian 10 Buster

6 views
Skip to first unread message

Calvin Irby

unread,
Jun 6, 2021, 9:46:52 PMJun 6
to link-grammar
Hello all, 

I've been trying for several days now to install Link Grammar and wasn't successful. Multiple approaches have been tried and I just cannot get the Python bindings to work properly. If someone could take a look at the steps I took or even offer an alternative, I'm open to anything. My goal is to just start programming in Python and feed sentences in Link Grammar to check for grammar. Please see below for the steps I took on a fresh install of Crostini which is Debian 10 Buster on Chrome OS.

-Thanks!

=======================================================================

Taken from the link: https://pypi.org/project/pylinkgrammar/

New install of Crostini - Debian 10 Buster

$ sudo apt update

$ sudo apt upgrade

$ sudo apt-get install software-properties-common

$ sudo apt-add-repository ppa:python-pylinkgrammar/getsome


 Link Grammar source and libraries, as well as the python bindings that depend on them.

This is an "unsanctioned" release of the link-grammar libs, with a version bump to 4.7.6.


Hopefully, a "stable" PPA will be coming soon, and then on to the main repos.

 More info: https://launchpad.net/~python-pylinkgrammar/+archive/ubuntu/getsome

Press [ENTER] to continue or ctrl-c to cancel adding it


gpg: keybox '/tmp/tmp2b032o1f/pubring.gpg' created

gpg: /tmp/tmp2b032o1f/trustdb.gpg: trustdb created

gpg: key 50E59F00E91F46F4: public key "Launchpad PPA for Linkgrammar for Python" imported

gpg: Total number processed: 1

gpg:               imported: 1

gpg: no valid OpenPGP data found.


$ sudo apt-get install liblink-grammar4

$ sudo apt install python3-pip

$ pip3 install pylinkgrammar


Collecting pylinkgrammar

  Downloading https://files.pythonhosted.org/packages/30/6d/ecf22d016279bda0887f48993646a63c5219085f25fd0c8d88a7358486bd/pylinkgrammar-0.2.14.tar.gz

Building wheels for collected packages: pylinkgrammar

  Running setup.py bdist_wheel for pylinkgrammar ... error

  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-lcunqz3f/pylinkgrammar/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-edeq_hel --python-tag cp37:

  running bdist_wheel

  running build

  running build_py

  creating build

  creating build/lib.linux-x86_64-3.7

  creating build/lib.linux-x86_64-3.7/pylinkgrammar

  copying pylinkgrammar/tests.py -> build/lib.linux-x86_64-3.7/pylinkgrammar

  copying pylinkgrammar/clinkgrammar.py -> build/lib.linux-x86_64-3.7/pylinkgrammar

  copying pylinkgrammar/__init__.py -> build/lib.linux-x86_64-3.7/pylinkgrammar

  copying pylinkgrammar/linkgrammar.py -> build/lib.linux-x86_64-3.7/pylinkgrammar

  running build_ext

  building 'pylinkgrammar/_clinkgrammar' extension

  swigging pylinkgrammar/link_grammar.i to pylinkgrammar/link_grammar_wrap.c

  swig -python -o pylinkgrammar/link_grammar_wrap.c pylinkgrammar/link_grammar.i

  unable to execute 'swig': No such file or directory

  error: command 'swig' failed with exit status 1

  

  ----------------------------------------

  Failed building wheel for pylinkgrammar

  Running setup.py clean for pylinkgrammar

Failed to build pylinkgrammar

Installing collected packages: pylinkgrammar

  Running setup.py install for pylinkgrammar ... error

    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-lcunqz3f/pylinkgrammar/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-cviyxgit/install-record.txt --single-version-externally-managed --compile --user --prefix=:

    running install

    running build

    running build_py

    creating build

    creating build/lib.linux-x86_64-3.7

    creating build/lib.linux-x86_64-3.7/pylinkgrammar

    copying pylinkgrammar/tests.py -> build/lib.linux-x86_64-3.7/pylinkgrammar

    copying pylinkgrammar/clinkgrammar.py -> build/lib.linux-x86_64-3.7/pylinkgrammar

    copying pylinkgrammar/__init__.py -> build/lib.linux-x86_64-3.7/pylinkgrammar

    copying pylinkgrammar/linkgrammar.py -> build/lib.linux-x86_64-3.7/pylinkgrammar

    running build_ext

    building 'pylinkgrammar/_clinkgrammar' extension

    swigging pylinkgrammar/link_grammar.i to pylinkgrammar/link_grammar_wrap.c

    swig -python -o pylinkgrammar/link_grammar_wrap.c pylinkgrammar/link_grammar.i

    unable to execute 'swig': No such file or directory

    error: command 'swig' failed with exit status 1

    

    ----------------------------------------

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-lcunqz3f/pylinkgrammar/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-cviyxgit/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-install-lcunqz3f/pylinkgrammar/


Linas Vepstas

unread,
Jun 6, 2021, 9:56:12 PMJun 6
to link-grammar, Calvin Irby
That's easy!

1) you should subscribe to the mailing list, else you will risk not seeing replies; I am cc'ing you directly on this email.

2) Do NOT use ppa:python-pylinkgrammar/getsome and do NOT use pylinkgrammar -- that package is very old and has bit-rotted into oblivion.

If you are using debian, then it already comes with everything; let me cut-n-paste:
```
$ apt search link-grammar
Sorting... Done
Full Text Search... Done
liblink-grammar-dev/stable 5.5.1-6 amd64
  Carnegie Mellon University's link grammar parser (development headers)

liblink-grammar-java/stable 5.5.1-6 amd64
  Carnegie Mellon University's link grammar parser (JNI library)

liblink-grammar5/stable 5.5.1-6 amd64
  Carnegie Mellon University's link grammar parser (libraries)

link-grammar/stable 5.5.1-6 amd64
  Carnegie Mellon University's link grammar parser

link-grammar-dictionaries-all/stable,stable 5.5.1-6 all
  Carnegie Mellon University's link grammar parser (all dictionaries)

link-grammar-dictionaries-en/stable,stable 5.5.1-6 all
  Carnegie Mellon University's link grammar parser (English dictionary)

python-link-grammar/stable 5.5.1-6 amd64
  Carnegie Mellon University's link grammar parser (Python 2)

python-link-grammar-examples/stable,stable 5.5.1-6 all
  CMU's link grammar parser (Python examples)

python3-link-grammar/stable 5.5.1-6 amd64
  Carnegie Mellon University's link grammar parser (Python 3)
```

All you need to do is to `apt install python3-link-grammar` and everything should "just work". Then read through the examples.

It would be wise to carefully remove everything from your failed attempt; those libraries/packages might pollute/corrupt the standard packages.

--linas



--
You received this message because you are subscribed to the Google Groups "link-grammar" group.
To unsubscribe from this group and stop receiving emails from it, send an email to link-grammar...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/link-grammar/92d94053-42fc-47f4-bf9f-5ba816d470a7n%40googlegroups.com.


--
Patrick: Are they laughing at us?
Sponge Bob: No, Patrick, they are laughing next to us.
 

Calvin Irby

unread,
Jun 7, 2021, 8:30:18 AMJun 7
to link-grammar
Hey thanks for that Linas,

Yes, I executed those two steps and I think they worked just fine. Except executing "link-parser" on the command line doesn't return any results. Also, where on the system would the example files live? I checked /usr/lib/python3/dist-packages/linkgrammar/ and didn't see any example.py files or anything like that. 

Calvin Irby

unread,
Jun 7, 2021, 8:39:07 AMJun 7
to link-grammar
Whoops nevermind! Found it! -Thanks!!!

Calvin Irby

unread,
Jun 7, 2021, 8:45:01 AMJun 7
to link-g...@googlegroups.com
Although I think I did: I was able to load the quick example from the Python3 interpreter and launch the linkages diagram. The documentation for this small example says examples.py has more information. Where is that again?

Linas Vepstas

unread,
Jun 7, 2021, 11:12:29 AMJun 7
to link-grammar
In debian-based systems, dpkg -L <package-name> will list all the files in that package. So, in this case, `dpkg -L python-link-grammar-examples` should tell you where they are.

If there are any missing, you can get the originals from github at

--linas

p.s.
the command-line binary is in the `link-grammar` package, so if its missing, you would have to install that.

p.p.s I just noticed that the debian-stable version of link grammar is 3 years old. The newer versions are a bit faster, and improve english coverage slightly, but otherwise the older version should work fine.

--linas

Reply all
Reply to author
Forward
0 new messages