當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。