I want to create a reinforcement learning model using stable-baselines3 PPO that can drive OpenAI Gym Car racing environment and I have been having a lot of errors and package compatibility issues. I have currently this code just for random actions
import gym
from stable_baselines3 import PPO
environment_name = "CarRacing-v0"
env = gym.make(environment_name)
episodes = 5
for episode in range(1, episodes+1):
state = env.reset()
done = False
score = 0
while not done:
env.render()
action = env.action_space.sample()
n_state, reward, done, info = env.step(action)
score+=reward
print('Episode:{} Score:{}'.format(episode, score))
env.close()
Runnning on Ubuntu 20.04, in VSCode Jupyter notebook. With these packages in a conda env

Even with random actions I am currently getting an error on state = env.reset()

I tried different versions of gym and other packages and none seem to work flawlessly. Could anyone please help me, my only requirement is to make it work (firstly random and then with PPO) no matter what versions of packages.
Thank you
Hello there seems like environment has error
change
environment_name = "CarRacing-v0"to asenvironment_name = "CarRacing-v2"it might fix erorrand if doesnt work uninstall and install again
or
after you uninstall it install it again
and remember,
you need to install Pytorch if you didn't it might be the problem https://pytorch.org/get-started/locally/
(Sorry for late answer)