Skip to content
This repository has been archived by the owner on Sep 11, 2021. It is now read-only.

Python 2.7.16 installed already, installs 2.7.15 anyways #191

Closed
keithnbrown opened this issue Jul 10, 2019 · 12 comments · Fixed by #204 or #205
Closed

Python 2.7.16 installed already, installs 2.7.15 anyways #191

keithnbrown opened this issue Jul 10, 2019 · 12 comments · Fixed by #204 or #205

Comments

@keithnbrown
Copy link

I have python 2.7.16 installed installed for all users at c:\python27, and 3.7.4 installed for all users in c:\python37

Both of those and thier respective "scripts" subdirectories are in my path.

Yet when i run this npm installer, it installs 2.7.15 as if i didn't have python already. I'm fairly lucky my python was installed for all users, otherwise this would have taken precidence in the path.

Why can this not find my already-installed python 2.7.16?
My guess is that it sees my python 3 install and goes "I need python 2 though, so i'll install it" without checking to see if i have python 2 beneath it. Either that or it's looking for the 2.7.15 version specifically, finds my 2.7.16 install and deems it unusable

What can be done here?

@felixrieseberg
Copy link
Owner

Hm, that sounds like a bug - we check if Python is installed by running python -v. Could you run that on your machine and tell me that the output is?

@keithnbrown
Copy link
Author

keithnbrown commented Jul 12, 2019

Python 3.7.4
or Python 2.7.16 if i have that earlier in my PATH

@keithnbrown
Copy link
Author

to clarify, I default to 3, so that will be the one it sees

@DestinyHunter
Copy link

I have the same problem

@xmedeko
Copy link

xmedeko commented Sep 1, 2019

@keithnbrown @DestinyHunter you must have Python 2.7 in your PATH (before python 3), so python -V must return Python 2.7.xx. Or use virtualenvwrapper-win to switch to Python 2 just for your project.

@felixrieseberg It would be ideal if the Windows Python py.exe utility could be used, i.e. py -2.7 -V.

Also, the code should check npm config get python and do not install python if it's already set? Or maybe some switch to skip python could be enough.

@keithnbrown
Copy link
Author

@xmedeko That shouldn't be a requirement. I use Python 3 as my daily version, and as python 2 is near EOL, this code should use (or at least be aware of) python 3, and be more inteligent in how it is detected.

Windows has option of the py version selector if it was installed when python 3 was installed. So simply checking for that and querying if python 2 is installed though it would be a good start

@xmedeko
Copy link

xmedeko commented Sep 3, 2019

@keithnbrown I've written the comment to you as a workaround for the current version. Next, I've written to @felixrieseberg suggestion "It would be ideal ..." for future - and that's similar what you have written.

@keithnbrown
Copy link
Author

I only read the bit directed at myself, so yes i missed the suggestion. But a workaround like that is simply not on, espeicailly with less than 4 months until EOL and when the py version selector has existed for longer.
This should use python 3 by the new year, not just be altered the prevent this issue but still use 2

@xmedeko
Copy link

xmedeko commented Sep 3, 2019

windows-build-tools just install necessary stuff for node-gyp. node-gyp requires python2, windows-build-tools cannot change it.

@keithnbrown
Copy link
Author

ugh, fair enough, and i jsut read their readme, they're explicity not supporting pyhton 3 for some reason

@Dragory
Copy link

Dragory commented Oct 7, 2019

Node-gyp seems to support Python 3 now. They recommend installing the official release from the Microsoft store, but I assume windows-build-tools would still install it normally?

@Josverl
Copy link

Josverl commented Nov 12, 2019

indeed according to : https://github.com/nodejs/node-gyp#option-2
python 3 will work fine and python 2.7 is no longer needed.
(Thanks for all the work on that; It was good while it lasted)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
6 participants