pywordnet install problems

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • vdrab

    #1

    pywordnet install problems

    hello pythoneers,

    I recently tried to install wordnet 2.0 and pywordnet on both an ubuntu
    linux running python 2.4 and a winXP running activePython 2.4.1, and I
    get the exact same error on both when I try to "from wordnet import *"
    :

    running install
    error: invalid Python installation: unable to open
    /usr/lib/python2.4/config/Makefile (No such file or directory)

    Adding the directories and files in question (touch Makefile) makes the
    install go through but (obviously) breaks the import of wordnet.py:
    [color=blue][color=green][color=darkred]
    >>> import wordnet[/color][/color][/color]
    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    File "wordnet.py ", line 1348, in ?
    N = Dictionary(NOUN , 'noun')
    File "wordnet.py ", line 799, in __init__
    self.indexFile = _IndexFile(pos, filenameroot)
    File "wordnet.py ", line 945, in __init__
    self.rewind()
    File "wordnet.py ", line 958, in rewind
    if (line[0] != ' '):
    IndexError: string index out of range

    Is this pywordnet package abandoned, are there weird versioning issues,
    or am I just extremely unlucky for the install to fail on two machines?

    any help greatly appreciated,
    vdrab.

  • Steven Bethard

    #2
    Re: pywordnet install problems

    vdrab wrote:[color=blue]
    > hello pythoneers,
    >
    > I recently tried to install wordnet 2.0 and pywordnet on both an ubuntu
    > linux running python 2.4 and a winXP running activePython 2.4.1, and I
    > get the exact same error on both when I try to "from wordnet import *"
    > :
    >
    > running install
    > error: invalid Python installation: unable to open
    > /usr/lib/python2.4/config/Makefile (No such file or directory)
    >
    > Adding the directories and files in question (touch Makefile) makes the
    > install go through but (obviously) breaks the import of wordnet.py:
    >[color=green][color=darkred]
    >>>>import wordnet[/color][/color]
    >
    > Traceback (most recent call last):
    > File "<stdin>", line 1, in ?
    > File "wordnet.py ", line 1348, in ?
    > N = Dictionary(NOUN , 'noun')
    > File "wordnet.py ", line 799, in __init__
    > self.indexFile = _IndexFile(pos, filenameroot)
    > File "wordnet.py ", line 945, in __init__
    > self.rewind()
    > File "wordnet.py ", line 958, in rewind
    > if (line[0] != ' '):
    > IndexError: string index out of range
    >
    > Is this pywordnet package abandoned, are there weird versioning issues,
    > or am I just extremely unlucky for the install to fail on two machines?[/color]

    Which version of WordNet do you have installed? I remember that when I
    tried upgrading to the current version of WordNet, pywordnet broke. I
    don't think the module is maintained very well; I've submitted a number
    of bug reports and RFE patches and not had any of them responded to. If
    I had the time, I'd pick up the project, but I don't at the moment...

    STeVe

    Comment

    • vdrab

      #3
      Re: pywordnet install problems

      hello Steve,

      I had WordNet 2.0 installed but just now I tried it with 1.7.1 as well
      and the result was the same. It's a shame, glossing over the pywordnet
      page really made me want to give it a try.
      Are there any workarounds you can recommend ?
      I had a quick look at the wordnet.py file, and it looks readable enough
      to try and fiddle around with it, but if possible I'd like to avoid
      having to mess with the source file.
      Is there any other person / list I can ask for help on this?

      thanks a lot.
      vdrab.

      Comment

      • Steven Bethard

        #4
        Re: pywordnet install problems

        vdrab wrote:[color=blue]
        > I had WordNet 2.0 installed but just now I tried it with 1.7.1 as well
        > and the result was the same. It's a shame, glossing over the pywordnet
        > page really made me want to give it a try.
        > Are there any workarounds you can recommend ?[/color]

        What's your wordnet setup like? I have mine installed in:
        C:\Program Files\WordNet\2 .0
        and I have an environment variable WNHOME set:
        WNHOME=C:\Progr am Files\WordNet\2 .0
        That seems to work for me.
        [color=blue]
        > I had a quick look at the wordnet.py file, and it looks readable enough
        > to try and fiddle around with it, but if possible I'd like to avoid
        > having to mess with the source file.
        > Is there any other person / list I can ask for help on this?[/color]

        Unfortunately, I wasn't able to find anyone else...

        STeVe

        Comment

        • vdrab

          #5
          Re: pywordnet install problems

          Thanks, I already figured it out a few days ago.

          In the wordnet.py file, just override the path (WNHOME and/or WNSEARCH)
          to the wordnet 2.0directory that has the lexnames files etc... (on my
          ubuntu box: '/usr/share/wordnet')
          That seems to fix it, although python gives a few warnings at startup.
          checking the web it seems this is a known issue.
          Thanks for the help though... I didn't bother posting the solution as I
          thought noone was interested anymore.

          cheers,
          vdrab.

          Comment

          Working...