Unable to initialize device PRN in Python

前端 未结 8 1301
盖世英雄少女心
盖世英雄少女心 2021-02-07 01:22

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 fi

8条回答
  •  情书的邮戳
    2021-02-07 01:54

    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 to add the Python installation path to my PATH environment variable.

    • On Windows 10, go to Settings and search for Environment
    • Click on Edit environment variables for your account
    • Select Path and click the Edit button
    • If the path to your Python.exe is not listed, click the New button
    • Enter the path to your Python.exe application and click the OK button
      • The path for me was %LocalAppData%\Programs\Python\Python37-32\
    • Restart VS Code and try to run your python script again

提交回复
热议问题