aiplan4eu / unified-planning

The AIPlan4EU Unified Planning Library
Apache License 2.0
181 stars 39 forks source link

broken initialisation of ENHSPAnytimeEngine on python3.8 #575

Closed nicholasRossetti closed 5 months ago

nicholasRossetti commented 6 months ago

Hi, I installed unified planning using the command pip install unified-planning[engines] in docker https://hub.docker.com/r/huggingface/transformers-pytorch-gpu using python 3.8 but using the imports: import unified_planning from unified_planning.shortcuts import * I obtain the following error doing every command in UP: File /usr/local/lib/python3.8/dist-packages/up_enhsp/enhsp_planner.py:95, in ENHSPAnytimeEngine() 94 class ENHSPAnytimeEngine(ENHSPEngine, PDDLAnytimePlanner): ---> 95 def init(self, params: str | None = None): 96 ENHSPEngine.init(self,params) 97 PDDLAnytimePlanner.init(self)

TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

alvalentini commented 6 months ago

The error is due to a syntax introduced in python 3.10.

Try to upgrade up-enhsp to version 0.0.25.

MathisFederico commented 6 months ago

I had the same problem, but it was fixed when bumping to up-enhsp>=0.0.25

alvalentini commented 5 months ago

This issue seems to be fixed now, so I close the issue. Feel free to reopen it if the problem is not completely solved.