0

Here's the download and instructions I followed.

Heres are the errors that I see when I run the commands:

$ 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/tmpamyb7e49/pubring.gpg' created
gpg: /tmp/tmpamyb7e49/trustdb.gpg: trustdb created
gpg: key 50E59F00E91F46F4: public key "Launchpad PPA for Linkgrammar for Python" imported
gpg: Total number processed: 1
gpg:               imported: 1
OK

$ sudo apt-get install liblink-grammar4
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package liblink-grammar4


**max@max-Latitude-E6410:~$** pip install pylinkgrammar

Collecting pylinkgrammar
  Using cached 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/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-5WPIa0/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/tmpk2yg0rpip-wheel- --python-tag cp27:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-2.7
  creating build/lib.linux-x86_64-2.7/pylinkgrammar
  copying pylinkgrammar/tests.py -> build/lib.linux-x86_64-2.7/pylinkgrammar
  copying pylinkgrammar/__init__.py -> build/lib.linux-x86_64-2.7/pylinkgrammar
  copying pylinkgrammar/clinkgrammar.py -> build/lib.linux-x86_64-2.7/pylinkgrammar
  copying pylinkgrammar/linkgrammar.py -> build/lib.linux-x86_64-2.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/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-5WPIa0/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-vu3zyF-record/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-2.7
    creating build/lib.linux-x86_64-2.7/pylinkgrammar
    copying pylinkgrammar/tests.py -> build/lib.linux-x86_64-2.7/pylinkgrammar
    copying pylinkgrammar/__init__.py -> build/lib.linux-x86_64-2.7/pylinkgrammar
    copying pylinkgrammar/clinkgrammar.py -> build/lib.linux-x86_64-2.7/pylinkgrammar
    copying pylinkgrammar/linkgrammar.py -> build/lib.linux-x86_64-2.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/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-5WPIa0/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-vu3zyF-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-5WPIa0/pylinkgrammar/
Zanna
  • 70,465

2 Answers2

0

The instructions you are following appear to have been written for a previous version of Ubuntu. This leaves us with few options.

Option 1) Attempt installation with the currently available versions of the required packages. This approach fails as of the date of this edit due to the fact that liblink-grammar5-dev is currently unavailable and is required.

Installing liblink-grammar-dev doesn't help either and also fails.

See Option 2:

It looks like liblink-grammar4 is unavailable for 17.04 (Zesty).

It seems that for more recent versions of Ubuntu it's been replaced by liblink-grammer5. Usually dependencies call for a version to be equal or greater than a specific version so a newer version should work.

In order to install that you need to first enable the universe repository.

Then issue the command sudo apt install liblink-grammer5

If you (like me) get an error like:

No origin found for file us.archive.ubuntu.com_ubuntu_dists_zesty-updates_main_dep11_Components-amd64.yml.gz

Then you are likely impacted by this bug or something similar. I worked around this with the command appstreamcli refresh --force

If you still get an Unable to locate package error, you can download the package directly from here and install it via gdebi with sudo gdebi PackageName or in my case sudo gdebi liblink-grammar5_5.3.14-1_amd64.deb

Your output also contains an error locating the package swig. Since we've already enabled the universe repository in order to obtain liblink-grammer5 we need only to issue the command sudo apt install swig to obtain that package. Now that you've resolved what appear to be the dependencies you should be able to successfully pip install pylinkgrammar

Option 2)

Dual boot or virtualize 16.04 and install and run pylinkgrammer on a version of Ubuntu that still offers liblink-grammer4 and liblink-grammer4-dev.

I would expect either of these approaches to work once liblink-grammar5-dev is released for 17.04, but currently (since that has yet to occur, Option 2 is your best choice.

Elder Geek
  • 36,023
  • 25
  • 98
  • 183
  • Okay Elder Geek, so I ran the code, after getting the universe repositories and getting swig. Yet, I am still having issues when I run the last command to install pylinkgrammar. Would you be able to confirm that it works? – max_user Aug 09 '17 at 10:32
  • Your welcome. You may find this useful as well. – Elder Geek Aug 09 '17 at 13:24
  • Hi Elder Geek, I am still having issues for some reason. Are you able to run the code? – max_user Aug 11 '17 at 11:02
  • @max_user Sorry, I have my hands full for the next couple days. If you are having issues with pip this may be useful. https://packaging.python.org/tutorials/installing-packages/ – Elder Geek Aug 11 '17 at 21:44
  • No problem Elder Geek, I will check out the link you gave and keep investigating. ;) – max_user Aug 13 '17 at 18:44
  • Nope for some reason I am still getting the same error that it is failing to install the wheel for pylink grammar. – max_user Aug 13 '17 at 19:39
  • Updated answer after testing. – Elder Geek Aug 14 '17 at 13:57
  • I just wanted to get back in touch with you Elder Geek. It turns out after speaking with google group on link grammar this link: https://github.com/opencog/link-grammar did the trick. The package comes with all the python bindings too. I finally got it set up -thanks for your help nonetheless – max_user Aug 14 '17 at 22:26
  • @max_user I'm glad you got it sorted. Please write up an answer so that others with your issue can benefit from your experience. – Elder Geek Aug 15 '17 at 02:01
0

Here is the link that has the solution to the issue. Python users running Ubuntu would run these commands. The packages at Pylinkgrammar are severely out of date. Therefore, one must download the tar bell file of link grammar and built it themselves.

Link Grammar 5.4 has had a new release. Get the tar file at Abiword: Get the download at Abiword

The link to commands to build link grammar *Please see the "Creating the System section"