/usr/bin/env: python, No such file or directory
<p>I write code working with mapreduce in Ubuntu System in Vmware. Now I have two snippets of code with the same header but one is right and another one report </p>

<pre><code>/usr/bin/env: python  
: No such file or directory
</code></pre>

<p>error. This is the one report error:</p>

<pre><code>#!/usr/bin/env python  
import sys
if __name__ == '__main__':
    rowNum = 100
    colNum = 100
    for line in sys.stdin:
        type, row, col, val = line.strip().split()
        if type == 'A':
            for k in range(colNum):
                print '%s,%s\t%s:%s,%s' %  (row, k, type, col, val)
        elif type == 'B':
            for k in range(rowNum):
                #index1, index2, element = line.split(',')
                print '%s,%s\t%s:%s,%s' % (k, col, type, row, val)
        else: continue
</code></pre>

<p>This is correct one. It works well.</p>

<pre><code>#!/usr/bin/env python  

import sys

# input comes from STDIN (standard input) 
if __name__ == '__main__':
        for line in sys.stdin:
            # remove leading and trailing whitespace  
            line = line.strip()
            # split the line into words  
            words = line.split()
            # increase counters  
            for word in words:
                # write the results to STDOUT (standard output);  
                # what we output here will be the input for the  
                # Reduce step, i.e. the input for reducer.py  
                #  
                # tab-delimited; the trivial word count is 1  
                print '%s\t%s' % (word, 1)
</code></pre>

<p>I search the whole website and try their method to fix it. But none of them worked, including finding the path is correct or not, checking whether there is a                                     carriage return. I was stun in them whole day because they have the same header but one can not find it.</p>

<p>You have an colon : after the /usr/bin/env   you need to remove it.</p>

python shell