当前位置: 首页>>代码示例>>Python>>正文


Python error.DependencyNotInstalled方法代码示例

本文整理汇总了Python中gym.error.DependencyNotInstalled方法的典型用法代码示例。如果您正苦于以下问题:Python error.DependencyNotInstalled方法的具体用法?Python error.DependencyNotInstalled怎么用?Python error.DependencyNotInstalled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gym.error的用法示例。


在下文中一共展示了error.DependencyNotInstalled方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from gym import error [as 别名]
# 或者: from gym.error import DependencyNotInstalled [as 别名]
def __init__(self, output_path, frame_shape, frames_per_sec):
        self.proc = None
        self.output_path = output_path
        # Frame shape should be lines-first, so w and h are swapped
        h, w, pixfmt = frame_shape
        if pixfmt != 3 and pixfmt != 4:
            raise error.InvalidFrame("Your frame has shape {}, but we require (w,h,3) or (w,h,4), i.e. RGB values for a w-by-h image, with an optional alpha channl.".format(frame_shape))
        self.wh = (w,h)
        self.includes_alpha = (pixfmt == 4)
        self.frame_shape = frame_shape
        self.frames_per_sec = frames_per_sec

        if distutils.spawn.find_executable('avconv') is not None:
            self.backend = 'avconv'
        elif distutils.spawn.find_executable('ffmpeg') is not None:
            self.backend = 'ffmpeg'
        else:
            raise error.DependencyNotInstalled("""Found neither the ffmpeg nor avconv executables. On OS X, you can install ffmpeg via `brew install ffmpeg`. On most Ubuntu variants, `sudo apt-get install ffmpeg` should do it. On Ubuntu 14.04, however, you'll need to install avconv with `sudo apt-get install libav-tools`.""")

        self.start() 
开发者ID:ArztSamuel,项目名称:DRL_DeliveryDuel,代码行数:22,代码来源:video_recorder.py

示例2: __init__

# 需要导入模块: from gym import error [as 别名]
# 或者: from gym.error import DependencyNotInstalled [as 别名]
def __init__(self, final_path, frame_shape, frames_per_sec):
        self.proc = None
        self.final_path = final_path
        _, self.output_path = tempfile.mkstemp(suffix='.mp4')
        # Frame shape should be lines-first, so w and h are swapped
        h, w, pixfmt = frame_shape
        if pixfmt != 3 and pixfmt != 4:
            raise error.InvalidFrame("Your frame has shape {}, but we require (w,h,3) or (w,h,4), i.e. RGB values for a w-by-h image, with an optional alpha channl.".format(frame_shape))
        self.wh = (w,h)
        self.includes_alpha = (pixfmt == 4)
        self.frame_shape = frame_shape
        self.frames_per_sec = frames_per_sec

        if distutils.spawn.find_executable('avconv') is not None:
            self.backend = 'avconv'
        elif distutils.spawn.find_executable('ffmpeg') is not None:
            self.backend = 'ffmpeg'
        else:
            raise error.DependencyNotInstalled("""Found neither the ffmpeg nor avconv executables. On OS X, you can install ffmpeg via `brew install ffmpeg`. On most Ubuntu variants, `sudo apt-get install ffmpeg` should do it. On Ubuntu 14.04, however, you'll need to install avconv with `sudo apt-get install libav-tools`.""")

        self.start() 
开发者ID:sharadmv,项目名称:parasol,代码行数:23,代码来源:utils.py

示例3: __init__

# 需要导入模块: from gym import error [as 别名]
# 或者: from gym.error import DependencyNotInstalled [as 别名]
def __init__(self, output_path, frame_shape, frames_per_sec):
        self.proc = None
        self.output_path = output_path
        # Frame shape should be lines-first, so w and h are swapped
        h, w, pixfmt = frame_shape
        if pixfmt != 3 and pixfmt != 4:
            raise error.InvalidFrame("Your frame has shape {}, but we require (w,h,3) or (w,h,4), i.e., RGB values for a w-by-h image, with an optional alpha channel.".format(frame_shape))
        self.wh = (w,h)
        self.includes_alpha = (pixfmt == 4)
        self.frame_shape = frame_shape
        self.frames_per_sec = frames_per_sec

        if distutils.spawn.find_executable('avconv') is not None:
            self.backend = 'avconv'
        elif distutils.spawn.find_executable('ffmpeg') is not None:
            self.backend = 'ffmpeg'
        else:
            raise error.DependencyNotInstalled("""Found neither the ffmpeg nor avconv executables. On OS X, you can install ffmpeg via `brew install ffmpeg`. On most Ubuntu variants, `sudo apt-get install ffmpeg` should do it. On Ubuntu 14.04, however, you'll need to install avconv with `sudo apt-get install libav-tools`.""")

        self.start() 
开发者ID:hust512,项目名称:DQN-DDPG_Stock_Trading,代码行数:22,代码来源:video_recorder.py

示例4: _error

# 需要导入模块: from gym import error [as 别名]
# 或者: from gym.error import DependencyNotInstalled [as 别名]
def _error(self):
        """docstring for _print_error"""
        msg = 'Importing MujocoEnv failed. Please run: \n' + \
              '\n`pip install mujoco-py` \n\n' + \
              'and visit: ' + \
              'https://github.com/openai/mujoco-py/'
        raise DependencyNotInstalled(msg) 
开发者ID:learnables,项目名称:learn2learn,代码行数:9,代码来源:dummy_mujoco_env.py


注:本文中的gym.error.DependencyNotInstalled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。