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

Gyp dependency on Windows despite shipping precompiled binary #458

Closed
SteveSanderson opened this issue Jun 7, 2016 · 5 comments
Closed
Labels

Comments

@SteveSanderson
Copy link

SteveSanderson commented Jun 7, 2016

Hi - I was hoping to be able to use sharp in some ASP.NET samples because it looked like it would install easily on Mac/Linux/Windows.

However, when installing via npm install --save sharp on a stock Windows 10 machine I'm getting the following error:

gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-    gyp\lib\configure.js:401:14)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:356:11
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:117:15)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd myproject\node_modules\sharp
gyp ERR! node -v v6.2.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok

Of course, python isn't generally installed on typical Windows developer or production server machines, so this error is to be expected if gyp gets involved.

What I had been hoping is that your pre-bundling of the binary libvips would mean this situation didn't occur, and no external dependencies (such as python) would be needed.

Can you let me know if I'm understanding this correctly?

  • Is python really mandatory for installing this on Windows? If so it would be great if you would amend your docs to emphasise this, as it hugely influences which projects will be able to use sharp. People won't generally install python.
  • Is it possible that a python/gyp requirement could be eliminated in the case of Windows installs, since you just need to download the precompiled binary?

Thanks. And BTW everything else about sharp worked magnificently - the API is beautiful and the performance was a couple of orders of magnitude better than I was getting from jimp before.

@SteveSanderson SteveSanderson changed the title Installation error on Windows Gyp dependency on Windows despite shipping precompiled binary Jun 8, 2016
@lovell
Copy link
Owner

lovell commented Jun 8, 2016

Hi Steve, thanks for your interest.

sharp depends on node-gyp at install time and Python, MSVC etc. are dependencies of node-gyp. I'd be happy to accept a PR to improve the clarity of these docs.

#186 covers the adoption of node-pre-gyp, which would involve shipping pre-compiled versions of sharp (in addition to pre-compiled versions of libvips currently provided).

@lovell lovell added the question label Jun 8, 2016
@lovell
Copy link
Owner

lovell commented Jul 5, 2016

nodejs/node-gyp#962 might remove the need for Python.

@lovell
Copy link
Owner

lovell commented Jul 28, 2016

@SteveSanderson
Copy link
Author

Thanks for the responses! It's been a while, but I'd still definitely be interested in using sharp more heavily in those ASP.NET samples if the Windows install process does get smoothed out. We probably wouldn't want to rely on windows-build-tools, as fetching a complete Python environment just to install one NPM module somewhat undermines the idea that it can be a quick, natural fit to use the technologies together.

I'll look forward to progress on #186, especially if the use of prebuild-install doesn't involve installing extra system-wide tools first (e.g., you don't need to run npm install -g prebuild-install first).

Thanks so much for your work on this!

@lovell
Copy link
Owner

lovell commented Feb 9, 2017

Yes, #186 should remove the need for Python+MSVC. I'd like for initial testing to be on Windows as that's the most complex platform for native modules.

I'll close this question and let's continue tracking/discussion at #186.

@lovell lovell closed this as completed Feb 9, 2017
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

2 participants