Skip to content

On Windows, can we use py to shortcut the search for Python? #2871

Closed
@cclauss

Description

https://docs.python.org/3/using/windows.html#getting-started recommends using py on Windows. On Linux and macOS the use of py requires an optional python-launcher add-on but on Windows, the py command has been the link to the system-wide executable since Python 3.3.

The first two lines of the log below are the right thing to do. But on lines 3 thru 5 (on Windows only!), instead of stumbling around looking for python3, should this code first be looking for py?

npm ERR! gyp verb find Python Python is not set from command line or npm configuration
npm ERR! gyp verb find Python Python is not set from environment variable PYTHON
npm ERR! gyp verb find Python checking if "python3" can be used
npm ERR! gyp verb find Python - executing "python3" to get executable path
npm ERR! gyp verb find Python - "python3" is not in PATH or produced an error
npm ERR! gyp verb find Python checking if "python" can be used
npm ERR! gyp verb find Python - executing "python" to get executable path
npm ERR! gyp verb find Python - executable path is "C:\Users\me\AppData\Local\Programs\Python\Python311\python.exe"
npm ERR! gyp verb find Python - executing "C:\Users\me\AppData\Local\Programs\Python\Python311\python.exe" to get version
npm ERR! gyp verb find Python - version is "3.11.4"
npm ERR! gyp info find Python using Python version 3.11.4 found at "C:\Users\me\AppData\Local\Programs\Python\Python311\python.exe"

@brettcannon

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions