aiplan4eu / unified-planning

The AIPlan4EU Unified Planning Library
Apache License 2.0
193 stars 41 forks source link

Exception UPNoRequestedEngineAvailableException issue #549

Open ndenicoo opened 10 months ago

ndenicoo commented 10 months ago

User Story

Im trying the library in Jupyter Notebook. I tried to solve the following simple problem.

from unified_planning.shortcuts import *

x = Fluent("x")

a = InstantaneousAction("a")
a.add_precondition(Not(x))
a.add_effect(x, True)

problem = Problem("basic")
problem.add_fluent(x)
problem.add_action(a)
problem.set_initial_value(x, False)
problem.add_goal(x)

with OneshotPlanner(name='pyperplan') as planner:
    result = planner.solve(problem)
    if result.status == up.engines.PlanGenerationResultStatus.SOLVED_SATISFICING:
        print("Pyperplan returned: %s" % result.plan)
    else:
        print("No plan found.")

However, I get the following error

File ~\anaconda3\Lib\site-packages\unified_planning\engines\factory.py:504, in Factory._get_engine_class(self, operation_mode, name, problem_kind, optimality_guarantee, compilation_kind, plan_kind, anytime_guarantee)
    502         return self._engines[name]
    503     else:
--> 504         raise up.exceptions.UPNoRequestedEngineAvailableException
    505 problem_features = list(problem_kind.features)
    506 planners_features = []

UPNoRequestedEngineAvailableException: 

Previously I installed

pip install unified_planning[pyperplan]

and the following text appeared: Requirement already satisfied: unified_planning[pyperplan] in c:\users\nicor\anaconda3\lib\site-packages (1.0.0) Requirement already satisfied: pyparsing in c:\users\nicor\anaconda3\lib\site-packages (from unified_planning[pyperplan]) (3.0.9) Requirement already satisfied: networkx in c:\users\nicor\anaconda3\lib\site-packages (from unified_planning[pyperplan]) (3.1) Requirement already satisfied: up-pyperplan==1.0.0 in c:\users\nicor\anaconda3\lib\site-packages (from unified_planning[pyperplan]) (1.0.0) Requirement already satisfied: pyperplan==2.1 in c:\users\nicor\anaconda3\lib\site-packages (from up-pyperplan==1.0.0->unified_planning[pyperplan]) (2.1) Requirement already satisfied: wheel in c:\users\nicor\anaconda3\lib\site-packages (from pyperplan==2.1->up-pyperplan==1.0.0->unified_planning[pyperplan]) (0.38.4)

alvalentini commented 10 months ago

Hi @ndenicoo! Are you sure you installed unified_planning[pyperplan] in the same python environment where you are running the notebook?