1

I am encountering an error when attempting to install pylinkgrammar on a Mac:

pylinkgrammar/link_grammar_wrap.c:2955:10: fatal error: 'link-grammar/link-includes.h' file     not found

#include <link-grammar/link-includes.h>


1 error generated.

error: command 'cc' failed with exit status 1

The same problem is described here: Missing file when installing pylinkgrammar

But the solutions apply only for Ubuntu, since MacPorts does not have the packages liblink-grammar4 and liblink-grammar4-dev.

Edit: I forgot to mention that I have installed link-grammar using MacPorts. This error appears nonetheless.

Community
  • 1
  • 1
iddober
  • 1,254
  • 4
  • 23
  • 43

2 Answers2

3

It seems the MacPorts package doesn't include the development headers.

I was able to successfully build pylinkgrammar against the link-grammar package from homebrew though:

And then install pylinkgrammar as usual.

Lukas Graf
  • 30,317
  • 8
  • 77
  • 92
  • Hi, what ```link-grammar``` and ```pylinkgrammar``` versions are you using? I'm getting errors when I try a vanilla install – Alex Spangher Aug 14 '17 at 20:16
  • 1
    @AlexSpangher not sure what the version was I installed when I wrote this answer, but just tried with homebrew again, `link-grammar-5.3.15` and its Python bindings installed without a hitch. – Lukas Graf Aug 14 '17 at 20:20
  • Sorry for the trouble, the brew install: ```brew install link-grammar``` works fine, and ```brew info link-grammar``` shows all the dependencies are successful, but when I try to ```pip install pylinkgrammar```, it's failing with a bunch of errors. Was the python binding you used ```pylinkgrammar```? – Alex Spangher Aug 14 '17 at 20:42
  • 1
    No worries ;-) No, I used (for testing, I'm not actually using LG currently) the Python bindings it comes with (`import linkgrammar`). Indeed, if I try `pip install pylinkgrammar` in a virtualenv, I also get a ton of compile time errors. – Lukas Graf Aug 14 '17 at 20:47
  • Ahh gotcha. Seems like we're getting the same errors, then... unfortunate, as ```pylinkgrammar``` does seem to work in Ubuntu. Importing ```linkgrammar``` works for me, though. Thanks! – Alex Spangher Aug 14 '17 at 20:49
  • ```linkgrammar``` seems to be missing some functions that ```pylinkgrammar``` has, though, like ```dictionary_create```. Am I just missing something? – Alex Spangher Aug 14 '17 at 20:51
  • 1
    Not sure, it's been years since I used LG, sorry. – Lukas Graf Aug 14 '17 at 20:57
  • 1
    @AlexSpangher The corresponding function in the current bindings for dictionary_create() is `Dictionary()`. – ampli Apr 11 '18 at 11:01
1

This is an old question, but pylinkgrammar was obsolete even then. It works only with a very old release of Link-Grammar which is totally out of date.

The current Link-Grammar already includes the Python bindings (for both Python 2 & 3). The fastest way to install it on Mac is still using Homebrew (as @LukasGraf mentioned in his answer).

(This answer includes info on how to use the Python bindings and how to interpret the sentence linkage output.)

ampli
  • 141
  • 2
  • 7