FG
💻 Software

Making `#!/usr/bin/env python` work on Windows

Fresh7 days ago
Mar 15, 202650007 views
Confidence Score0%
0%

Problem

I use Bash on Windows, provided by MSYS. I tried to run a Python file with a shebang of , but I get this error message: What can I do to make this work? I know I can launch the Python file by suffixing it with , but I want it to work without the suffix too.

Error Output

/usr/bin/env: python: No such file or directory

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Making `#!/usr/bin/env python` work on Windows

Low Risk

Use the proper path where Python is installed instead, for example: If you have Unix-like path support on your system (I'm not familiar with MSYS), you can always enter the path to your executable, i.e. the output of .

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment