Okay, my problem was that in post NameError: name 'config' is not defined when PIO pulled the Expressif files from Git - #18 by maxgerhardt the folder bin is mentioned but in my case I had to run in Scripts folder like this:
~/.platformio/penv/.espidf-5.4.1/Scripts/activate
~/.platformio/penv/.espidf-5.4.1/Scripts/python -m pip install rich