How do I resolve 'NoneType' object has no attribute 'write' error with scikit-learn digits dataset?

后端 未结 1 1174
既然无缘
既然无缘 2020-12-12 03:14

I\'m trying to do the first exercise on scikit-learn, but even when I run their solution code (shown below) I get the error in the code block immediately following. Does any

相关标签:
1条回答
  • 2020-12-12 03:55

    If you read the traceback message it means that the variable file in the expression file.write(warnings.formatwarning(message, category, filename, ...) is set to None instead of the expected channel (for instance the standard output of the program or a buffer in the user interface).

    This means that this is probably a bug in IDLE. If you google the error message you will get:

    http://bugs.python.org/issue18030

    which in turn points to:

    http://bugs.python.org/issue13582

    So this bug is indeed not related to scikit-learn. I would suggest you to:

    • either launch IDLE from the cmd console by typing python -m idlelib.idle

    • or use a different Python IDE / environment.

    0 讨论(0)
提交回复
热议问题