Help After First Command


#1

I am using the tutorial found here: https://www.youtube.com/watch?v=mGYU5t8MO7s
After typing “import gym”, I got “ImportError: No module named ‘gym’”.
I’m not sure what to do; please help.
I am new to OpenAI and Python, and I am using Python version 3.5.


#2

just looked at the tutorial!
I found it very informative and helpful as i am completely new to OpenAI as well.
Have you installed gym?
if no see link for installation directions: https://github.com/openai/gym
Adam


#3

Trying to do a “minimal install of gym” with:
"git clone https://github.com/openai/gym.git
cd gym
pip install -e ."
results in “SyntaxError: invalid syntax”


#4

I just did the minimal install using the same commands as you and had no problems installing:

git clone https://github.com/openai/gym.git
cd gym
pip install -e .

Are you running pip from the command line?


#5

I don’t know if I am running pip from the command line, but the error occurs before the pip command. After every command, I get the same invalid syntax error.


#6

You might be running the commands in The Python shell! That would explain the SyntaxError.
Just hit CTRL D to exit python shell and run commands on the command line and that should do it.


#7

CTRL D types “^D”, and pressing enter after that just gives another syntax error.


#8

A few questions:
Are you running this in a linux environment?
Do you have git installed?
Do you have pip installed?


#9

I am using Windows, so I believe I am not running in a Linux environment.
I do not believe I have git installed.
I do not believe I have pip installed.
: /


#10

So, some bad news then. As far as I know, Universe/Gym is a beezy to get working on windows. Not to mention the download and installation commands are for linux/mac machines. What I would recommend, if you are really trying to get into this, is to make a linux virtual machine on you computer and download it there. It’s a bit of work (took me a day), but there are directions online. Do you have any questions?


#11

I now have a Linux virtual machine (running on Google’s servers). After installing and opening Python, I used the commands shown in the video (https://youtu.be/mGYU5t8MO7s?t=3m54s). After the third command, I got an error. (I ran Python with -v for more detailed information.)

>>> import gym
# possible namespace for /home/user/PythonTest/PythonTest/bin/gym
import 'gym' # None
>>> import universe
# possible namespace for /home/user/PythonTest/PythonTest/bin/universe
import 'universe' # None
>>> env = gym.make('flashgames.CoasterRacer-v0')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'make'