openai / gym

A toolkit for developing and comparing reinforcement learning algorithms.
https://www.gymlibrary.dev
Other
34.19k stars 8.58k forks source link

Error related to import gym #3280

Open SExpert12 opened 1 week ago

SExpert12 commented 1 week ago

Hi, I am getting this error. I have installed gym and still it shows error is about "import gym".

~/RL-Carla-main/Carla-RL$ python train_sac.py --model-name sem_sac --width 96 --height 96 --repeat-action 4 --start-location highway --sensor semantic --episode-length 600 Traceback (most recent call last): File "train_sac.py", line 1, in import gym ImportError: No module named gym /RL-Carla-main/Carla-RL$ pip install gym Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: gym in /home/.local/lib/python3.8/site-packages (0.17.3) Requirement already satisfied: cloudpickle<1.7.0,>=1.2.0 in /home/.local/lib/python3.8/site-packages (from gym) (1.6.0) Requirement already satisfied: numpy>=1.10.4 in /home/.local/lib/python3.8/site-packages (from gym) (1.23.1) Requirement already satisfied: pyglet<=1.5.0,>=1.4.0 in /home/.local/lib/python3.8/site-packages (from gym) (1.5.0) Requirement already satisfied: scipy in /home/.local/lib/python3.8/site-packages (from gym) (1.4.1) Requirement already satisfied: future in /usr/lib/python3/dist-packages (from pyglet<=1.5.0,>=1.4.0->gym) (0.18.2) ryzen@ryzen:/RL-Carla-main/Carla-RL$ python train_sac.py --model-name sem_sac --width 96 --height 96 --repeat-action 4 --start-location highway --sensor semantic --episode-length 600 Traceback (most recent call last): File "train_sac.py", line 1, in import gym ImportError: No module named gym

How to resolve this error?

pseudo-rnd-thoughts commented 1 week ago

Defaulting to user installation because normal site-packages is not writeable is in your error message Therefore gym is not actually being installed

SExpert12 commented 1 week ago

Hey, Thanks for your reply but how to resolve this? I am not much into coding.

pseudo-rnd-thoughts commented 6 days ago

I have no idea but I'm guessing that the location of your python install is read only for some reason. I would google how to fix this

SExpert12 commented 6 days ago

Okay. Thanks.