When I use "!pip install gym[box2d]", the last line will report an error.
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> See above for output.
so I replaced the last line of code:
!pip install gymnasium[box2d]