As someone, whose post has been deleted for some reason, just posted, it was indeed a problem with the Python version being too new and libcst apparently not yet compatible. It works when I go back to 3.10.