0

I'm learning to code with python 3.9, but the resources I'm using are referred to a previous build. In one of the exercises I'm supposed to use pythonw.exe to run a script in the background, however I don't have such file in my installation folder.

After searching online, I have found that the file must have been automatically deleted by the antivirus during the install. So I uninstalled and reinstalled again while disabling the antivirus during the install (malwarebytes + win defender), but pythonw is still missing.

At this point I don't know if there is another workaround or if there is an alternative to pythonw for version 3.9.. Anyone can help shed some light?

3
  • 1
    pythonw is a third-party package: pypi.org/project/pythonw Commented Oct 8, 2021 at 22:23
  • 1
    @Barmar that package is at least suspicious, starting with being OS-independent, having no description, etc. Perhaps malicious too. pythonw.exe is the same to python.exe as javaw.exe is to java.exe: it doesn't open a console window, on Windows. And it's included even in the embeddable package, docs.python.org/3/using/windows.html#the-embeddable-package Commented Oct 8, 2021 at 22:30
  • OP: you can just try running your code with python.exe, the difference is having/not having an extra console window appearing on the screen. Commented Oct 8, 2021 at 22:32

2 Answers 2

1

pythonw.exe should be in the same directory as python.exe. For me (running Python 3.8) that is C:\Program Files\Python38. With a different install option, it probably would be in C:\Python38. (Yours would presumably have "Python39" where I have "Python38".)

Did you get your Python installation file from python.org? It should include pythonw.exe; if you got your distribution from somewhere else, it may be tailored differently.

The difference between python.exe and pythonw.exe is that pythonw.exe will avoid opening an extra window. If you don't care about that, go ahead and use python.exe.

By the way, I have both MalwareBytes and Windows Defender installed, and neither of those have ever deleted pythonw.exe for me, so I doubt that's your issue.

Sign up to request clarification or add additional context in comments.

Comments

0

Actually 5 minutes after posting the question I found the solution.

I reinstalled python enabling the option "install for all users". Now the file is there..

2 Comments

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
That's probably not the reason. "install for all users" changes the install so that Python (3.9) is installed into C:\Python39 instead of C:\Program Files\Python39; but should not affect what files are installed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.