EOF error in python 2.7 (not in python 3.5)
See original GitHub issueI got an error when running consoleLabel
on Jupyter notebook (my Jupyter version is 4.1.0
) using Python 2.7 as follows.
dedupe.consoleLabel(deduper)
Here is an error:
EOFError Traceback (most recent call last)
<ipython-input-41-5f16b23568e5> in <module>()
----> 1 dedupe.consoleLabel(deduper)
~/anaconda2/lib/python2.7/site-packages/dedupe/convenience.pyc in consoleLabel(deduper)
55 while not valid_response:
56 print('(y)es / (n)o / (u)nsure / (f)inished', file=sys.stderr)
---> 57 label = input()
58 if label in ['y', 'n', 'u', 'f']:
59 valid_response = True
EOFError: EOF when reading a line
I’m wondering if there is an error for others who use Python 2.7 also. Or, the error is raised because of Jupyter notebook. I see no error when using Python 3.5.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Correcting EOF error in python in Codechef - GeeksforGeeks
EOF stands for End Of File. Well, technically it is not an error, rather an exception. This exception is raised when one of...
Read more >How to solve EOF Error in the below code? - Stack Overflow
I have solved the issue using try and except block as follows: from datetime import datetime try: a = int(input()) while a !=...
Read more >Why would the EOFError exception be raised in Python 3, and ...
In simple terms, it means that you have reached the end of a file, such as using file.readlines(). It's not a bad error,...
Read more >EOFError: EOF when reading a line - DEV Community
In Python, an EOFError is an exception that gets raised when functions such as input() or raw_input() in case of python2 return end-of-file ......
Read more >Built-in Exceptions — Python 3.11.1 documentation
Raised when the input() function hits an end-of-file condition (EOF) without reading any data. (N.B.: the io.IOBase.read() and io.IOBase.readline() methods ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
All good. I ended up getting it to work by basically doing exactly what you suggested by replacing line 4 with:
Thanks!
Hello @nateyoder! it has been quite a while on this issue. I don’t remember how I solved an issue actually. I’m not sure if changing convenience.py#L56 from
input
toraw_input
will help solve the problem or not. In this case, you might have to downloaddedupe
, fix L56, and usesetup.py
in order to install the library.