
import sys
import subprocess


return_value = 0

required_packages = ['numpy', 'scipy', 'matplotlib', 'SimpleITK']
for package in required_packages:
    print('Importing ' + package + ' ...')
    try:
        __import__(package, globals(), locals(), [], 0)
    except ImportError:
        print('Error: could not import ' + package)
        return_value += 1


required_executables = ['git', 'dexy', 'ipython', 'nosetests']
for executable in required_executables:
    print('Executing ' + executable + ' ...')
    try:
        output = subprocess.check_output([executable, '--help'])
    except OSError:
        print('Error: could not execute ' + executable)
        return_value += 1


if return_value is 0:
    print('\nSuccess.')
else:
    print('\nAn error was found in your environment, please see the messages ' +
          'above.')
sys.exit(return_value)


import sys
import subprocess


return_value = 0

required_packages = ['numpy', 'scipy', 'matplotlib', 'SimpleITK']
for package in required_packages:
    print('Importing ' + package + ' ...')
    try:
        __import__(package, globals(), locals(), [], 0)
    except ImportError:
        print('Error: could not import ' + package)
        return_value += 1


print('')
required_executables = ['git', 'dexy', 'ipython', 'nosetests', 'ffmpeg']
for executable in required_executables:
    print('Executing ' + executable + ' ...')
    try:
        output = subprocess.check_output([executable, '--help'],
                                         stderr=subprocess.STDOUT)
    except OSError:
        print('Error: could not execute ' + executable)
        return_value += 1


if return_value is 0:
    print('\nSuccess.')
else:
    print('\nAn defect was found in your environment, please see the messages ' +
          'above.')
sys.exit(return_value)

Add ffmpeg to the required environment.
Add ffmpeg to the required environment.

  
  import sys
  import subprocess
  
  
  return_value = 0
  
  required_packages = ['numpy', 'scipy', 'matplotlib', 'SimpleITK']
  for package in required_packages:
      print('Importing ' + package + ' ...')
      try:
          __import__(package, globals(), locals(), [], 0)
      except ImportError:
          print('Error: could not import ' + package)
          return_value += 1
  
  
+ print('')
- required_executables = ['git', 'dexy', 'ipython', 'nosetests']
+ required_executables = ['git', 'dexy', 'ipython', 'nosetests', 'ffmpeg']
  for executable in required_executables:
      print('Executing ' + executable + ' ...')
      try:
-         output = subprocess.check_output([executable, '--help'])
+         output = subprocess.check_output([executable, '--help'],
+                                          stderr=subprocess.STDOUT)
      except OSError:
          print('Error: could not execute ' + executable)
          return_value += 1
  
  
  if return_value is 0:
      print('\nSuccess.')
  else:
-     print('\nAn error was found in your environment, please see the messages ' +
+     print('\nAn defect was found in your environment, please see the messages ' +
            'above.')
  sys.exit(return_value)
  
Add ffmpeg to the required environment.
## Code Before:

import sys
import subprocess


return_value = 0

required_packages = ['numpy', 'scipy', 'matplotlib', 'SimpleITK']
for package in required_packages:
    print('Importing ' + package + ' ...')
    try:
        __import__(package, globals(), locals(), [], 0)
    except ImportError:
        print('Error: could not import ' + package)
        return_value += 1


required_executables = ['git', 'dexy', 'ipython', 'nosetests']
for executable in required_executables:
    print('Executing ' + executable + ' ...')
    try:
        output = subprocess.check_output([executable, '--help'])
    except OSError:
        print('Error: could not execute ' + executable)
        return_value += 1


if return_value is 0:
    print('\nSuccess.')
else:
    print('\nAn error was found in your environment, please see the messages ' +
          'above.')
sys.exit(return_value)

## Instruction:
Add ffmpeg to the required environment.
## Code After:

import sys
import subprocess


return_value = 0

required_packages = ['numpy', 'scipy', 'matplotlib', 'SimpleITK']
for package in required_packages:
    print('Importing ' + package + ' ...')
    try:
        __import__(package, globals(), locals(), [], 0)
    except ImportError:
        print('Error: could not import ' + package)
        return_value += 1


print('')
required_executables = ['git', 'dexy', 'ipython', 'nosetests', 'ffmpeg']
for executable in required_executables:
    print('Executing ' + executable + ' ...')
    try:
        output = subprocess.check_output([executable, '--help'],
                                         stderr=subprocess.STDOUT)
    except OSError:
        print('Error: could not execute ' + executable)
        return_value += 1


if return_value is 0:
    print('\nSuccess.')
else:
    print('\nAn defect was found in your environment, please see the messages ' +
          'above.')
sys.exit(return_value)
