VS Code: Unable to initialize the PRN device (Python 3.7.2)

Asked

Viewed 1,939 times

0

Hello! I’m having a problem configuring Python in VS Code. When you execute the command print('Olá Mundo!'), the terminal returns:

Unable to initialize PRN device.

The VS Code version is: 1.30.2 (user setup)

In the path the path is correct. I don’t know what’s causing this error.

Thanks in advance...

2 answers

1

If you are on Windows, you have to call Python first for it to work:

  • 1-close your open prompt (if you are)
  • 2-open again and just type Python
  • 3- write again print('Olá Mundo!') and this will work!

-1


I had this same problem when I accidentally typed "print program.py "instead of"python program.py". Error message comes from Windows command line program called print.

  • 1

    It’s probably a coincidence, but your answer sounds like a translation this one, whether or not I suggest complementing the answer by giving the same suggestion that the author of the answer in English gave, and also changing the phrase "imprint program.py" by "print program.py" (that was what called me to search, very strange) :-)

  • I had fixed that. But I didn’t write that mention. This error appears in the fo vs code terminal. It must be a simple mistake, but I can’t figure out where it is

Browser other questions tagged

You are not signed in. Login or sign up in order to post.