Example #1
0
        import requests
    except ImportError as e:
        reraise(prefix='Failed to import package `requests`',suffix='HINT: `requests`'+hint)

    try:
        import six
    except ImportError as e:
        reraise(prefix='Failed to import package `six`',suffix='HINT: `six`'+hint)

    if distutils.version.StrictVersion(numpy.__version__) < distutils.version.StrictVersion('1.10.4'):
        raise error.DependencyNotInstalled('You have `numpy` version {} installed, but gym requires at least 1.10.4. HINT: If you directly cloned the GitHub repo, please run `pip install -r requirements.txt` first.'.format(numpy.__version__))

    if distutils.version.StrictVersion(requests.__version__) < distutils.version.StrictVersion('2.0'):
        raise error.MujocoDependencyError('You have `requests` version {} installed, but gym requires at least 2.0. HINT: If you directly cloned the GitHub repo, please run `pip install -r requirements.txt` first.'.format(requests.__version__))

sanity_check_dependencies()

from gym.core import Env, Space
from gym.configuration import logger_setup, undo_logger_setup
from gym.envs import make, spec
from gym.scoreboard.api import upload

logger = logging.getLogger(__name__)

# We automatically configure a logger with a simple stderr handler. If
# you'd rather customize logging yourself, run undo_logger_setup.
logger_setup(logger)
del logger_setup

__all__ = ["Env", "Space", "make", "spec", "upload"]
Example #2
0
            "You have 'numpy' version %s installed, but 'gym' requires at least 1.10.4. HINT: upgrade via 'pip install -U numpy'.",
            numpy.__version__)

    if distutils.version.LooseVersion(
            requests.__version__) < distutils.version.LooseVersion('2.0'):
        logger.warn(
            "You have 'requests' version %s installed, but 'gym' requires at least 2.0. HINT: upgrade via 'pip install -U requests'.",
            requests.__version__)


# We automatically configure a logger with a simple stderr handler. If
# you'd rather customize logging yourself, run undo_logger_setup.
#
# (Note: this needs to happen before importing the rest of gym, since
# we may print a warning at load time.)
logger_setup(logger)
del logger_setup

sanity_check_dependencies()

from gym.core import Env, Space, Wrapper
from gym.envs import make, spec
from gym.scoreboard.api import upload

# *-*-*-*-*-*-*-* Monkey Patching *-*-*-*-*-*--*-*-*-*
import gym
import gym_pull.scoreboard.api
import gym_pull.monitoring.monitor
import gym_pull.envs.registration
gym.upload = gym_pull.scoreboard.api.upload
gym.scoreboard.api.upload = gym_pull.scoreboard.api.upload
Example #3
0
# We automatically configure a logger with a simple stderr handler. If
# you'd rather customize logging yourself, run undo_logger_setup.
#
# (Note: this code runs before importing the rest of gym, since we may
# print a warning at load time.)
#
# It's generally not best practice to configure the logger in a
# library. We choose to do so because, empirically, many of our users
# are unfamiliar with Python's logging configuration, and never find
# their way to enabling our logging. Users who are aware of how to
# configure Python's logging do have to accept a bit of incovenience
# (generally by caling `gym.undo_logger_setup()`), but in exchange,
# the library becomes much more usable for the uninitiated.
#
# Gym's design goal generally is to be simple and intuitive, and while
# the tradeoff is definitely not obvious in this case, we've come down
# on the side of auto-configuring the logger.
logger_setup()
del logger_setup

sanity_check_dependencies()

from gym.core import Env, Space, Wrapper, ObservationWrapper, ActionWrapper, RewardWrapper
from gym.benchmarks import benchmark_spec
from gym.envs import make, spec
from gym.scoreboard.api import upload
from gym import wrappers

__all__ = ["Env", "Space", "Wrapper", "make", "spec", "upload", "wrappers"]
Example #4
0
# you'd rather customize logging yourself, run undo_logger_setup.
#
# (Note: this code runs before importing the rest of gym, since we may
# print a warning at load time.)
#
# It's generally not best practice to configure the logger in a
# library. We choose to do so because, empirically, many of our users
# are unfamiliar with Python's logging configuration, and never find
# their way to enabling our logging. Users who are aware of how to
# configure Python's logging do have to accept a bit of incovenience
# (generally by caling `gym.undo_logger_setup()`), but in exchange,
# the library becomes much more usable for the uninitiated.
#
# Gym's design goal generally is to be simple and intuitive, and while
# the tradeoff is definitely not obvious in this case, we've come down
# on the side of auto-configuring the logger.

if not os.environ.get('GYM_NO_LOGGER_SETUP'):
    logger_setup()
del logger_setup

sanity_check_dependencies()

from gym.core import Env, Space, Wrapper, ObservationWrapper, ActionWrapper, RewardWrapper
from gym.benchmarks import benchmark_spec
from gym.envs import make, spec
from gym.scoreboard.api import upload
from gym import wrappers

__all__ = ["Env", "Space", "Wrapper", "make", "spec", "upload", "wrappers"]