I'm new to python, been learning it for the past few weeks. I recently started getting the following error when debugging a Python script in VS Code:
Exception has occurred: AttributeError
'NoneType' object has no attribute 'write'
File "C:\SW-Languages\__LEARNING\Learning Python\Ex_Files_Learning_Python\Exercise Files\Ch3\itertoolsPermutations.py", line 8, in <module>
print("Hello")
Here is the code (originally was more, but isolated it to this simple 1 line program:
print("Hello")
I installed VS Code from Anaconda, everything worked fine for the first couple of weeks, then I made an updates to anaconda (I don't recall details) and also installed new Python packages when the error first occurred.
The "Hello" script works fine when executed from a command shell (as do all my other python scripts, but basically I can only use VS Code for editing, none of my scripts will run in VS Code now, I have to execute them via a cmd shell.
Additional info:
from cmd shell:
C:\Users\jd400>python -VV
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)]
from VS Code terminal:
(base) PS C:\SW-Languages\__LEARNING\wxFormBuilder\wx-Widget-Examples\sc> python -VV
Python 3.7.2 (default, Feb 21 2019, 16:05:07) [MSC v.1915 64 bit (AMD64)]
I have researched the following related posts on stackoverflow, but they were no help:
How do I resolve 'NoneType' object has no attribute 'write' error with scikit-learn digits dataset?