Gym: python3

Created on 27 Apr 2016  路  7Comments  路  Source: openai/gym

It would be great if gym could support python3 for future proofing and supporting transition efforts.

Most helpful comment

Merged! Python 3 support is experimental, for now. Check out the instructions on https://github.com/openai/gym to clone the repo (didn't cut a new release for pip install yet).
Bug reports are greatly appreciated!

All 7 comments

I'm able to run all of the example simulations if I initalize imports wherver you see StringIO, xrange, and urlparse with:

try:
import StringIO #(if cStringIo I import ByteIO)
except ImportError:
from io import StringIO

try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse

try:
xrange
except NameError:
xrange = range

I'm sure there are other dependencies and this is bad, but I'm able to play around.

As someone who isn't familiar with this stuff but is eager to learn, why doesn't it work correctly with 3.5+? What is the advantage of 2.7?

No real advantage of 2 over 3 actually. Quite the opposite usually. There are just some incompatible/deprecated modules/keywords/libraries like StringIO, urlparse, xrange...

A library like python-future makes writing both py2 and py3 compatible code a bit easier.

is there a pull request with the changes?
I've been making changes to the source locally.. but i suck at git/vcs so i'd rather it not be me

Pull request for this: https://github.com/openai/gym/pull/22
If you find the time, would be great if somebody besides me could check out the source and poke at it to try and find obvious bugs.

Merged! Python 3 support is experimental, for now. Check out the instructions on https://github.com/openai/gym to clone the repo (didn't cut a new release for pip install yet).
Bug reports are greatly appreciated!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Spiral-Galaxy picture Spiral-Galaxy  路  3Comments

RuofanKong picture RuofanKong  路  4Comments

Ettrig picture Ettrig  路  3Comments

tornadomeet picture tornadomeet  路  4Comments

mdavis-xyz picture mdavis-xyz  路  3Comments