Cannot find noun.exc

412 views
Skip to first unread message

bigoperm

unread,
Sep 12, 2011, 8:26:47 AM9/12/11
to wn-perl
I'm trying to build/install WordNet::Similarity. I'm getting stuck at
the 'make' phase, where QueryData is giving me trouble:

$> make
/usr/bin/perl "-Iblib/arch" "-Iblib/lib" build/Depthfiles.PL blib/lib/
WordNet/synsetdepths.dat
Generating default depth files.
Loading WordNet::QueryData... Not able to open /usr/share/wordnet/dict/
noun.exc: No such file or directory at /usr/share/perl5/WordNet/
QueryData.pm line 338.
Compilation failed in require at build/Depthfiles.PL line 27.
make: *** [blib/lib/WordNet/synsetdepths.dat] Error 2

I've installed WordNet through the Ubuntu repositories, so the
libraries are in /usr/share/wordnet. I have set WNSEARCHDIR to that
location, and have left WNHOME undefined. It appears that Ubuntu does
not use the 'dict' directory underneath wordnet, however QueryData
makes this as an assumption:

$> find /usr -name 'noun.exc'
/usr/share/wordnet/noun.exc

What's the best way to proceed?

Jason Rennie

unread,
Sep 12, 2011, 9:35:35 AM9/12/11
to wn-...@googlegroups.com
Did you try this tip from the man page?

You can also pass the location of the database files directly to
QueryData.  To do this, pass the location to "new":
  my $wn = WordNet::QueryData->new("/usr/local/wordnet/dict");

Jason


--
You received this message because you are subscribed to the Google Groups "wn-perl" group.
To post to this group, send email to wn-...@googlegroups.com.
To unsubscribe from this group, send email to wn-perl+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/wn-perl?hl=en.




--
Jason Rennie
Research Scientist
ITA Software by Google
+1 617-446-3651


Benjamin R. Haskell

unread,
Sep 12, 2011, 2:40:20 PM9/12/11
to wn-perl

Are you sure you've set _and exported_ WNSEARCHDIR?

The following worked for me under an Ubuntu 9.10 VM (with
libwordnet-querydata-perl installed from 'universe' -- still in
/usr/share/wordnet, no '/dict').

$> cd WordNet-Similarity-2.05
$> WNSEARCHDIR=/usr/share/wordnet make
...
Generating default depth files.
Loading WordNet::QueryData... done
...etc...

Equivalently:

$> export WNSEARCHDIR=/usr/share/wordnet
$> cd WordNet-Similarity-2.05
$> make

--
Best,
Ben

bigoperm

unread,
Sep 13, 2011, 11:09:13 AM9/13/11
to wn-perl
> Are you sure you've set _and exported_ WNSEARCHDIR?

I think so:

$> tail -1 ~/.bashrc
export WNSEARCHDIR=/usr/share/wordnet
$> echo $WNSEARCHDIR
/usr/share/wordnet

> The following worked for me under an Ubuntu 9.10 VM (with
> libwordnet-querydata-perl installed from 'universe' -- still in
> /usr/share/wordnet, no '/dict').

I'm running:

$> uname -a
Linux [machine name] 2.6.32-33-generic #72-Ubuntu SMP Fri Jul 29
21:08:37 UTC 2011 i686 GNU/Linux

> $> cd WordNet-Similarity-2.05
> $> WNSEARCHDIR=/usr/share/wordnet make
> ...
> Generating default depth files.
> Loading WordNet::QueryData... done
> ...etc...
>
> Equivalently:
>
> $> export WNSEARCHDIR=/usr/share/wordnet
> $> cd WordNet-Similarity-2.05
> $> make

Nope, neither worked for me. I even tried:

$> perl Makefile.PL PREFIX=/usr/local WNSEARCHDIR=/usr/share/wordnet;
make && make test

(I generally run the Makefile.PL first.) It's almost as though Perl
isn't importing the environment correctly. Could this be the case?

$> perl --version
This is perl, v5.10.1 (*) built for i486-linux-gnu-thread-multi
[...]

Benjamin R. Haskell

unread,
Sep 13, 2011, 1:07:37 PM9/13/11
to wn-perl
On Tue, 13 Sep 2011, bigoperm wrote:

>> Are you sure you've set _and exported_ WNSEARCHDIR?
>
> I think so:
>
> $> tail -1 ~/.bashrc
> export WNSEARCHDIR=/usr/share/wordnet
> $> echo $WNSEARCHDIR
> /usr/share/wordnet
>

Yeah, looks right.

Do you have any other WN* variables set? WNHOME/WNSEARCHPATH? (I think
WNSEARCHPATH was just for our internal Perl lib, but I still had it set
on that VM.)

What version of WordNet::QueryData are you using? (searching for
somethin', here...)

$ perl -MWordNet::QueryData -lwe 'print $WordNet::QueryData::VERSION'
1.49

ChangeLog for 1.48 mentions some fixes for WNSEARCHDIR handling, but
it'd be surprising if you had something older than 1.49 (most recent,
and ~2 yrs old).


>> $> WNSEARCHDIR=/usr/share/wordnet make
>>
>> [...]
>>
>> $> export WNSEARCHDIR=/usr/share/wordnet


>> $> make
>
> Nope, neither worked for me. I even tried:
>
> $> perl Makefile.PL PREFIX=/usr/local WNSEARCHDIR=/usr/share/wordnet;
> make && make test
>
> (I generally run the Makefile.PL first.) It's almost as though Perl
> isn't importing the environment correctly. Could this be the case?

It shouldn't be the case that Makefile.PL's environment would matter.
The path doesn't get embedded into the library in any way.

(Another stretch:) I assume you're not using some crazy, locked-down
shell of some sort? Things like `sudo` strip environment variables that
aren't explicitly allowed. Some restricted shells have weird
limitations (though this one would seem like one that would break a lot
of things, not just this installation).

--
Best,
Ben

bigoperm

unread,
Sep 15, 2011, 1:34:18 AM9/15/11
to wn-perl
> Do you have any other WN* variables set?  WNHOME/WNSEARCHPATH?  (I think
> WNSEARCHPATH was just for our internal Perl lib, but I still had it set
> on that VM.)

$> env | grep 'WN'
WNSEARCHDIR=/usr/share/wordnet
$>

> What version of WordNet::QueryData are you using?  (searching for
> somethin', here...)
>
> $ perl -MWordNet::QueryData -lwe 'print $WordNet::QueryData::VERSION'
> 1.49
>
> ChangeLog for 1.48 mentions some fixes for WNSEARCHDIR handling, but
> it'd be surprising if you had something older than 1.49 (most recent,
> and ~2 yrs old).
>

$> perl -MWordNet::QueryData -lwe 'print $WordNet::QueryData::VERSION'
1.47

That could be the problem! I've installed QueryData using the Ubuntu
repositories, which report they are using 1.48. I had installed some
WordNet stuff prior to learning that a lot of it lived in the
repositories. I thought I'd gotten rid of all the old stuff prior to
using the Ubuntu stuff -- is there a way to figure out which QueryData
perl is using? Perhaps I've got an old version it's defaulting to...

Otherwise I'll ping the Ubuntu people and see what's going on.

> (Another stretch:)  I assume you're not using some crazy, locked-down
> shell of some sort?  Things like `sudo` strip environment variables that
> aren't explicitly allowed.  Some restricted shells have weird
> limitations (though this one would seem like one that would break a lot
> of things, not just this installation).

Thanks for stretching :) I'm thinking once I figure out this version-
ing issue I'll be good.

Benjamin R. Haskell

unread,
Sep 15, 2011, 2:02:00 AM9/15/11
to wn-perl
On Wed, 14 Sep 2011, bigoperm wrote:

>> What version of WordNet::QueryData are you using?  (searching for
>> somethin', here...)
>>
>> $ perl -MWordNet::QueryData -lwe 'print $WordNet::QueryData::VERSION'
>> 1.49
>>
>> ChangeLog for 1.48 mentions some fixes for WNSEARCHDIR handling, but
>> it'd be surprising if you had something older than 1.49 (most recent,
>> and ~2 yrs old).
>>
>
> $> perl -MWordNet::QueryData -lwe 'print $WordNet::QueryData::VERSION'
> 1.47
>
> That could be the problem! I've installed QueryData using the Ubuntu
> repositories, which report they are using 1.48. I had installed some
> WordNet stuff prior to learning that a lot of it lived in the
> repositories. I thought I'd gotten rid of all the old stuff prior to
> using the Ubuntu stuff -- is there a way to figure out which QueryData
> perl is using? Perhaps I've got an old version it's defaulting to...

Ha. I had the opposite problem (was using a newer version than the one
installed from the Ubuntu repos). Here's how to determine:

$ perl -MWordNet::QueryData -lwe 'print for $INC{"WordNet/QueryData.pm"}, $WordNet::QueryData::VERSION'
/usr/local/share/perl/5.10.0/WordNet/QueryData.pm
1.49

(as opposed to the repositories:)

$ perl -lwe '@INC = grep !m{/local}, @INC; require WordNet::QueryData; print for $INC{"WordNet/QueryData.pm"}, $WordNet::QueryData::VERSION'
/usr/share/perl5/WordNet/QueryData.pm
1.47


> Otherwise I'll ping the Ubuntu people and see what's going on.

Unfortunately, I still think it may be an Ubuntu issue. Using the
Ubuntu repositories version of WN::QD, I don't get the failures you're
seeing:

$ export PERL5LIB=$(perl -le 'print join ":", grep !m{/local}, @INC')
$ cd WordNet-Similarity-2.05
$ perl Makefile.PL
$ make
...
(completes successfully)

Are you sure noun.exc is there? I forgot about this issue, but the
official 3.0 "database-only" downloads don't have the exception lists
any more (since they don't change every time the DB does). Maybe Ubuntu
doesn't grab them?

--
Best,
Ben

bigoperm

unread,
Sep 26, 2011, 1:28:20 PM9/26/11
to wn-perl
I go this to work. I had to explicitly add WNHOME to the Makefile
environment:

$> perl Makefile.PL PREFIX=/usr/local WNHOME=/usr/local; make && make
test

worked,

$> perl Makefile.PL PREFIX=/usr/local; make && make test

didn't. Even though

$> echo $WNHOME
/usr/local

Strange...
Reply all
Reply to author
Forward
0 new messages