Can't import gym; ModuleNotFoundError: No module named 'gym'

enter image description here

Can't import gym;

ModuleNotFoundError: No module named 'gym' 

5 Answers

It seems to me that you're trying to use .

You'd want to run in the terminal (before typing python, when the $ prompt is visible):

pip install gym 

After that, if you run python, you should be able to run import gym.

I see that you're installing gym, so

pip install gym 

is unnecessary.

Please, try:

import sys sys.path.append('path') 

where path is directory with gym module.

6

run this:

pip install gym 

Then run your "import gym" again.

2

As you are using Anaconda as your package manager, use this to install gym

conda install -c conda-forge gym

this works for me to hope its work for you also!!

pip install --user gym 

You Might Also Like