title: converting python program into executable
body: <p>So now, I have a python program which I would like to convert into an executable(preferably a single file). Right now the target systems are only RedHat(and CentOS) and Debian(and Ubuntu). </p>
  
  <p>First, I've tried the PyInstaller but after running it, it creates a <strong>.spec</strong> file and 2 folders called build and dist. I have no idea how to proceed from there.</p>
  
  <p>Second, I tried the freeze.py which ships with python. I understand the usage is as follows:</p>
  
  <pre><code>python /path/to/freeze.py  /path/to/myfile.py
  </code></pre>
  
  <p>This throws an error <code>***Test Failed*** 2 failures</code> and <code>NameError: name 'testdata' is not defined</code> </p>
  
  <p>The full error is as follows:</p>
  
  <pre><code>**********************************************************************
  File "/usr/lib/python2.6/site-packages/freeze.py", line 117, in __main__.freeze
  Failed example:
      testdata = json.loads(
          gzip.open("testdata.json.gz", "r").read().decode()
      )
  Exception raised:
      Traceback (most recent call last):
        File "/usr/lib64/python2.6/doctest.py", line 1253, in __run
          compileflags, 1) in test.globs
        File "&lt;doctest __main__.freeze[3]&gt;", line 2, in &lt;module&gt;
          gzip.open("testdata.json.gz", "r").read().decode()
        File "/usr/lib64/python2.6/gzip.py", line 33, in open
          return GzipFile(filename, mode, compresslevel)
        File "/usr/lib64/python2.6/gzip.py", line 79, in __init__
          fileobj = self.myfileobj = __builtin__.open(filename, mode or 'rb')
      IOError: [Errno 2] No such file or directory: 'testdata.json.gz'
  **********************************************************************
  File "/usr/lib/python2.6/site-packages/freeze.py", line 121, in __main__.freeze
  Failed example:
      freeze(testdata) == freeze_fast(testdata)
  Exception raised:
      Traceback (most recent call last):
        File "/usr/lib64/python2.6/doctest.py", line 1253, in __run
          compileflags, 1) in test.globs
        File "&lt;doctest __main__.freeze[4]&gt;", line 1, in &lt;module&gt;
          freeze(testdata) == freeze_fast(testdata)
      NameError: name 'testdata' is not defined
  **********************************************************************
  1 items had failures:
     2 of   8 in __main__.freeze
  ***Test Failed*** 2 failures.
  </code></pre>
  
  <p>I'd like some help to using either of the 2 (or any other tool which will help me achieve the same result).</p>
  
  <p>Thanks.</p>