title: In general, should I write multiple versions of a code body in case a user is missing packages?
body: <p>Suppose that I'm building a Python program, and in the very beginning, I import two modules - <strong>something</strong>, which is included in the python libraries by default, and <strong>somethingElse</strong>, which isn't.</p>
  
  <p>I have two nearly-identical functions, one that works without <strong>somethingElse</strong>, but also a second version that works even better with it. While ideally, people would just install the required dependencies, I'd prefer if there accessible to users whose machines/systems are incompatible with the <strong>somethingElse</strong> package.
  <em>Example:</em></p>
  
  <pre><code>try:
     import something
     import somethingElse
  except ImportError:
     import something
  
  if not ImportError:
     versionA()
  
  else:
     versionB()
  </code></pre>
  
  <p>Is this good practice, or is there a better way to approach this problem?</p>
  
  <p>Thanks!</p>