Making Python scripts executable in Windows

Windows Python Launcher explanation

To launch a Python program on Windows, you normally have to type


after installing the Python Launcher, you can just type

On Linux/Mac, we already can just use


due to the correct shebang on the first line of

#!/usr/bin/env python

Don’t specify a shebang like #!/usr/bin/python except for specific situations like GNU Radio scripts where you specifically want system Python in some (but not all) cases.

Windows Python Launcher Installation

Unless you use CPython directly (most people don’t, most people use something like Anaconda Python, so you need to install Python Launcher on Windows.

  1. download the most recent launchwin*.amd64.msi
  2. double click that .msi file to install Python Launcher.
  3. open a new Command Prompt and type


    and verify your desired Python prompt is seen.

Now when you type in Windows Command Prompt

You will see that Python starts correctly.