I am running the following simple script from the book and getting the following error
from mrjob.job import MRJob
class MRWordCount(MRJob):
def mapper(self, _, line):
for word in line.split():
yield(word, 1)
def reducer(self, word, counts):
yield(word, sum(counts))
if __name__ == '__main__':
MRWordCount.run()
Using cygwin64 on windows 10 it returns the following error:
User001@Ubuntu /cygdrive/c/Users/User001/PycharmProjects/TestProject
$ python preparation.py input.txt
Traceback (most recent call last):
File "preparation.py", line 1, in <module>
from mrjob.job import MRJob
ImportError: No module named mrjob.job
Here is what I did:
I installed mrjob using
pip install mrjob
and it installed successfully.I have checked that files exist in site-packages/mrjob and job.py file also exist and I can open the file and see the methods inside that file.
I am using Pycharm so when I try to import mrjob it also gives me syntax completion that is pycharm recognizes where is the file.
Now I do not understand why it is unable to get this module. Can anybody help ? Thanks