MushroomRL / mushroom-rl

Python library for Reinforcement Learning.
MIT License
803 stars 145 forks source link

Python 3.11 support #144

Open Leon0402 opened 3 months ago

Leon0402 commented 3 months ago

Currently, only python <= 3.10 is supported, which is now 2.5 years old. The main reason for this, seems to be the ale-py package, which is hard-coded here to version 0.7.5

This dependency version is two years old and thus no python 3.11 support. This can be seen here. There are no prebuilt packages for 3.11 and neither does it have a source distribution, thus building the dependency from source is no option either.

I propose to upgrade this dependency to its newest version ^0.8 if possible, which has 3.11 support. Some other dependencies might need an upgrade too, dependency resolution stopped once no suitable versions for ale-py could be found.

A more long-term solution would be the integration of Dependabot or something similar to regularly upgrade dependencies. Additionally, extending the CI Pipeline to include coverage for different python versions might be useful to catch such problems.

boris-il-forte commented 3 months ago

We are aware of the issues with Gym and ale-py, but unfortunately, this will not be fixed in MushroomRL 1.x versions.

The main issue is that gym development has been particularly unstable in the last years and culminated in the deprecation of gym in favor of gymnasium.

MushroomRL 2.0 will move to gymnasium and will support later versions of ale-py, and obviously, python.

For version 2.0, the CI script will indeed use the newest version of Python and all the older versions for which we don't break the compatibility.

To be honest, except ale-py (that may still work on newer versions of Python) I'm not aware of any reasons preventing mushroom-rl to run on newer versions of Python. As a matter of fact, some of the Ph.D. students in our lab are using 3.11.

Notice, however, that the changes in the Python language and Python libraries may affect the results of the learning algorithms, particularly due to changes in the random number generator.

boris-il-forte commented 3 months ago

PS: notice that Dependabot will not solve our issue. our issue is due to some other libraries in the area breaking the interface (multiple times, in multiple subsequent versions)