Another newbie question

26 views
Skip to first unread message

Tom

unread,
Nov 19, 2009, 2:42:35 PM11/19/09
to PyKE
Hi all,

I'm sure this is a trivial question, so I really appreciate anyone
taking the time to answer it:

I'm trying to use Pyke to solve some taxonomy problems, within the
larger scope of inference.

I created a krb called taxonomy_rules.krb, within a folder called
taxonomy. I wanted to define a function, 'assertfacts', that takes a
rule_base and a particular framework and applies the rules within that
framework. When I try to run the following line by calling that
function:

engine.activate('taxonomy_rules')

I get this:

Traceback (most recent call last):
File "<pyshell#6>", line 1, in <module>
assert_facts()
File "<pyshell#5>", line 2, in assert_facts
engine = knowledge_engine.engine('taxonomy')
File "build\bdist.win32\egg\pyke\knowledge_engine.py", line 77, in
__init__
for path in paths: self._init_path(path, target_pkgs)
File "build\bdist.win32\egg\pyke\knowledge_engine.py", line 163, in
_init_path
target_pkg.import_(target_package_name[:last_dot]) \
File "build\bdist.win32\egg\pyke\target_pkg.py", line 304, in
import_
mod = __import__(modulename)
ImportError: No module named taxonomy

However, if I just try to run "engine.activate('taxonomy_rules')"
within my python IDLE, it works fine. Is there something wrong with
the paths here, and if so, how do I fix it?

Thanks again.

A.T.Hofkamp

unread,
Nov 20, 2009, 3:08:36 AM11/20/09
to py...@googlegroups.com
Tom wrote:
> engine.activate('taxonomy_rules')

> import_
> mod = __import__(modulename)
> ImportError: No module named taxonomy
>
> However, if I just try to run "engine.activate('taxonomy_rules')"
> within my python IDLE, it works fine. Is there something wrong with
> the paths here, and if so, how do I fix it?

Did you specify a python package directory, as stated at

http://pyke.sourceforge.net/using_pyke.html

?


Albert
Reply all
Reply to author
Forward
0 new messages