gym icon indicating copy to clipboard operation
gym copied to clipboard

Error related to import gym

Open SExpert12 opened this issue 1 year ago • 4 comments

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?

SExpert12 avatar Jun 26 '24 05:06 SExpert12

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

pseudo-rnd-thoughts avatar Jun 26 '24 20:06 pseudo-rnd-thoughts

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

SExpert12 avatar Jun 27 '24 03:06 SExpert12

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

pseudo-rnd-thoughts avatar Jun 27 '24 14:06 pseudo-rnd-thoughts

Okay. Thanks.

SExpert12 avatar Jun 28 '24 03:06 SExpert12