Reputation: 111
Can't import gym;
ModuleNotFoundError: No module named 'gym'
Upvotes: 11
Views: 69912
Reputation: 540
As you are using Anaconda as your package manager, use this to install gym
conda install -c conda-forge gym
Upvotes: 1
Reputation: 1
this works for me to hope its work for you also!!
pip install --user gym
Upvotes: 0
Reputation: 19486
It seems to me that you're trying to use https://pypi.org/p/gym.
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
.
Upvotes: 8
Reputation:
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.
Upvotes: 4