First rllib examples from O'Reilly 'Learning Ray' book not working

How severe does this issue affect your experience of using Ray?

  • High: It blocks me to complete my task.

Hi there!
I am trying to run the cartpole-ppo example from ‘Learning Ray’ (page 14) on my linux machine with Ubuntu 22.04.1 LTS.
As far as I am aware, I have correctly followed the prerequisite steps (in a new conda environment using python 3.9):

  1. pip install “ray[rllib, serve, tune]==2.2.0”
  2. pip install tensorflow
  3. pip install “gym==0.25.0”
  4. rllib example get cartpole-ppo
  5. pip install pygame

All of the above commands seem to work without any problems, however when I then run:
rllib example run cartpole-ppo

I receive a series of errors.

The first specifies that tensorflow-probability is not installed

After installing tensorflow probability with:
pip install --upgrade tensorflow-probability
I get another error specifying that tf-keras is not installed

After installing keras with:

  1. pip install --upgrade keras
  2. pip install --upgrade tensorflow-probability[tf]
    I get the next error:

Whilst I could continue plugging holes as with the other errors, I suspect that I may have done something wrong at some stage which could be causing all these problems.

Any help on how I could fix this/where I may have gone wrong would be greatly appreciated!

Thanks a lot,
Stefan