Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent python2 exe running #667

Closed
refack opened this issue Jul 19, 2015 · 4 comments
Closed

Inconsistent python2 exe running #667

refack opened this issue Jul 19, 2015 · 4 comments
Labels

Comments

@refack
Copy link
Contributor

refack commented Jul 19, 2015

My "weird" system has two executables named python2:

[12:59:24.60] c:\Users\refael>where python2
C:\Tools\res\scripts\python2.bat
C:\bin\msys64\usr\bin\python2.exe

[13:02:04.47] c:\Users\refael>C:\Tools\res\scripts\python2.bat -V
C:\bin\dev\python27\python.exe -V
Python 2.7.8

[13:02:06.15] c:\Users\refael>C:\bin\msys64\usr\bin\python2.exe -V
Python 2.7.9

When running node-gyp configure the wrong one is run:

...
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` succeeded python2 C:\Tools\res\scripts\python2.BAT
gyp verb check python version `python2 -c "import platform; print(platform.python_version());"` returned: "2.7.9\n"
...
refack pushed a commit to refack/node-gyp that referenced this issue Jul 19, 2015
@TooTallNate
Copy link
Contributor

Why is it the wrong one? returned: "2.7.9\n" <- that's the newer one.

@refack
Copy link
Contributor Author

refack commented Aug 15, 2015

Obviously the two calls find different exes, and are inconsistent.
which finds python2.bat, but trying to parse the exec() result fails, because node finds python2.exe (different file, with no . PYTHONPATH fix)
Anyway, on my system, 2.7.8 is win32, and 2.7.9 is msys2

@refack
Copy link
Contributor Author

refack commented Aug 15, 2015

So you are right @TooTallNate, this stems from node-which being inconsistent with child_process.execFile's lookup.
But in this case, if you're already calling which, why not use it's result as the explicit path to python2?

@refack
Copy link
Contributor Author

refack commented Oct 3, 2015

Relates to #750

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants