问题
I attempt to run a python program and the following pops up in command prompt:
"Unable to initialize device PRN"
I should also mention that the program runs fine.
回答1:
I had this same problem when I accidentally typed "print program.py" instead of "python program.py". The error message comes from the Windows command-line program named print. Those who suggested restarting the command prompt probably committed the same typo without noticing, and corrected it in their new command prompt.
回答2:
In my case restarting (close / open new) the console or the Command Prompt window works
回答3:
Try changing name of the program; that worked for me. Don't forget: use fresh cmd when you start executing.
回答4:
I know this is an old question, but I experienced this issue in VS Code after installing the latest version of Python and the Python extension.
To fix it, I just needed