Before installing dependencies run a check for the python-dev-is-python3 package and only install it if found (otherwise use python-dev). This allows older versions of debian (and derivatives) to properly install the defined dependencies.
stub_env
File.exists?