Pip not installing stable_baselines3

Whenever i try to install stable_baselines3 using “pip install stable_baselines3” it gives me the error` error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [1 lines of output]
error in gym setup command: ‘extras_require’ must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.`

If you are using 3.12.0, this is likely because stable_baselines3 has not yet uploaded a release for 3.12.

does not indicate that there is one yet. Wait a bit or try 3.11.

It’s caused by an error in the pinned version of gym… The stable_baselines3 package pins gym to version 0.21. This fails to install in Python 3.12. You could try to work around it by first installing the latest gym (which installs fine), and then checking out the source code of stable_baselines and fixing the setup…

thank you, this worked