Search code examples
pythonpython-3.xartificial-intelligenceopenai-gym

OpenAi Gym Installation - python version mismatch


I am trying to install openai gym on a fresh Ubuntu 16VM. I'm following the documentation to install the Atari package, but I keep running into problems:

When I run ipython > v2.7.12

>import gym
>gym.make('SpaceInvaders-v0')

I get :

....
TypeError: super() takes at least 1 argument (0 given)

It seems to run python3 code, however, during the installation I used the default settings. When I run

python3 > 3.5.2
> import gym
ImportError: No module named 'gym'

What am I doing wrong? I installed gym into the user environment with pip --user parameters.

Solution: Simple fix to use pip3 which is unfortunately not mentioned in the Readme :(


Solution

  • To install to a Python3 environment use the following command

    pip3 --user

    For debugging between Python2 and Python3 pip environments the following commands are often useful:

    pip3 --version

    pip --version

    It prints out the corresponding Python environment that it is attached to