题意:OpenAI Gym 安装 - Python 版本不匹配
问题背景:
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:
我正在尝试在一个全新的 Ubuntu 16 虚拟机上安装 OpenAI Gym。我按照文档安装 Atari 包,但不断遇到问题:
When I run ipython > v2.7.12 当我运行 `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
它似乎运行的是 Python 3 代码,但在安装过程中我使用了默认设置。当我运行时
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.
我做错了什么?我使用 `pip --user` 参数将 gym 安装到用户环境中。
Solution: Simple fix to use pip3
which is unfortunately not mentioned in the Readme :(
解决方案:简单的修复是使用 `pip3`,但遗憾的是,Readme 中没有提到这一点 :(
问题解决:
To install to a Python3 environment use the following command
要安装到 Python 3 环境中,请使用以下命令:
pip3 --user
For debugging between Python2 and Python3 pip
environments the following commands are often useful:
在 Python 2 和 Python 3 的 `pip` 环境之间进行调试时,以下命令通常很有用:
pip3 --version
pip --version
It prints out the corresponding Python environment that it is attached to
它会打印出它所附加的对应 Python 环境。