Files
Gymnasium/gym/__init__.py
MarCnu 9260271bef Replace StrictVersion by LooseVersion
Replaces the parsing function for the version comparison, to allow non standard versions. Remains unchanged for standard versions. http://epydoc.sourceforge.net/stdlib/distutils.version.LooseVersion-class.html
2016-05-20 17:40:17 +01:00

39 lines
1.4 KiB
Python

import distutils.version
import logging
import sys
from gym import error
from gym.configuration import logger_setup, undo_logger_setup
from gym.utils import reraise
logger = logging.getLogger(__name__)
# Do this before importing any other gym modules, as most of them import some
# dependencies themselves.
def sanity_check_dependencies():
import numpy
import requests
import six
if distutils.version.LooseVersion(numpy.__version__) < distutils.version.LooseVersion('1.10.4'):
logger.warn("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
from gym.envs import make, spec
from gym.scoreboard.api import upload
__all__ = ["Env", "Space", "make", "spec", "upload"]