You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What I am using:
Jupyter Notebook (most recent Anaconda3 release).
Python 3.5.2 |Anaconda custom (x86_64)| (default, Jul 2 2016, 17:52:12)
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin
Code:
from mr_word_count import MRWordFrequencyCount
mr_job = MRWordFrequencyCount(args=['my_file.txt'])
Issue:
Works in command line/.py script. Does not work in notebook.
Error in notebook:
`---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
in ()
2 from mr_word_count import MRWordFrequencyCount
3
----> 4 mr_job = MRWordFrequencyCount(args=['my_file.txt'])
5
6 with mr_job.make_runner() as runner:
Huh, looks like stdout and stderr are ipykernel.iostream.OutStream objects, which don't have a buffer attribute, but which seem perfectly happy to accept bytes as well as unicode.
I think I'll rewrite this code to look for the buffer attribute explicitly, rather than keying off Python version.
What I am using:
Jupyter Notebook (most recent Anaconda3 release).
Python 3.5.2 |Anaconda custom (x86_64)| (default, Jul 2 2016, 17:52:12)
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin
Code:
from mr_word_count import MRWordFrequencyCount
mr_job = MRWordFrequencyCount(args=['my_file.txt'])
Issue:
Works in command line/.py script. Does not work in notebook.
Error in notebook:
`---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
in ()
2 from mr_word_count import MRWordFrequencyCount
3
----> 4 mr_job = MRWordFrequencyCount(args=['my_file.txt'])
5
6 with mr_job.make_runner() as runner:
/Users/anaconda/lib/python3.5/site-packages/mrjob/job.py in init(self, args)
97
python -m mrjob.job --help
98 """
---> 99 super(MRJob, self).init(self.mr_job_script(), args)
100
101 @classmethod
/Users/anaconda/lib/python3.5/site-packages/mrjob/launch.py in init(self, script_path, args, from_cl)
126 else:
127 self.stdin = sys.stdin.buffer
--> 128 self.stdout = sys.stdout.buffer
129 self.stderr = sys.stderr.buffer
130
AttributeError: 'OutStream' object has no attribute 'buffer'`
The text was updated successfully, but these errors were encountered: