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

Python dependency on Windows needs to be documented #577

Closed
znmeb opened this issue Nov 26, 2016 · 5 comments
Closed

Python dependency on Windows needs to be documented #577

znmeb opened this issue Nov 26, 2016 · 5 comments

Comments

@znmeb
Copy link

znmeb commented Nov 26, 2016

I'm trying to install dat on a Windows 10 Pro laptop. I recently rebuilt the laptop partition so there's not much on it yet.

I installed Node.js 64-bit from the Node.js website, opened a Node command prompt and typed npm install -g dat. It took off but the install crashed looking for a Python interpreter in the PATH.

> [email protected] install C:\Users\znmeb\AppData\Roaming\npm\node_modules\dat\node_modules\rabin
> prebuild --install

prebuild WARN install No prebuilt binaries found (target=v6.9.1 arch=x64 platform=win32)
prebuild ERR! configure error
prebuild ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
prebuild ERR! stack     at failNoPython (C:\Users\znmeb\AppData\Roaming\npm\node_modules\dat\node_modules\node-gyp\lib\configure.js:449:14)
prebuild ERR! stack     at C:\Users\znmeb\AppData\Roaming\npm\node_modules\dat\node_modules\node-gyp\lib\configure.js:404:11
prebuild ERR! stack     at C:\Users\znmeb\AppData\Roaming\npm\node_modules\dat\node_modules\graceful-fs\polyfills.js:284:29
prebuild ERR! stack     at FSReqWrap.oncomplete (fs.js:123:15)
prebuild ERR! not ok
prebuild ERR! build Error: Can't find Python executable "python", you can set the PYTHON env variable.
prebuild ERR! build     at failNoPython (C:\Users\znmeb\AppData\Roaming\npm\node_modules\dat\node_modules\node-gyp\lib\configure.js:449:14)
prebuild ERR! build     at C:\Users\znmeb\AppData\Roaming\npm\node_modules\dat\node_modules\node-gyp\lib\configure.js:404:11
prebuild ERR! build     at C:\Users\znmeb\AppData\Roaming\npm\node_modules\dat\node_modules\graceful-fs\polyfills.js:284:29
prebuild ERR! build     at FSReqWrap.oncomplete (fs.js:123:15)
C:\Users\znmeb\AppData\Roaming\npm
`-- (empty)

I plan to install Miniconda 3 (Python 3) on this laptop soon, so all I need is a note in the documentation that Python 3 will work. If dat requires Python 2, I'll have to do some PATH hacking. ;-)

@znmeb
Copy link
Author

znmeb commented Nov 26, 2016

Sadly, it wants Python 2 - from the Miniconda command prompt, npm install -g dat yields

> [email protected] install C:\Users\znmeb\AppData\Roaming\npm\node_modules\dat\node_modules\rabin
> prebuild --install

prebuild WARN install No prebuilt binaries found (target=v6.9.1 arch=x64 platform=win32)
prebuild ERR! configure error
prebuild ERR! stack Error: Python executable "C:\Users\znmeb\Miniconda3\python.EXE" is v3.5.2, which is not supported by gyp.
prebuild ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
prebuild ERR! stack     at failPythonVersion (C:\Users\znmeb\AppData\Roaming\npm\node_modules\dat\node_modules\node-gyp\lib\configure.js:454:14)
prebuild ERR! stack     at C:\Users\znmeb\AppData\Roaming\npm\node_modules\dat\node_modules\node-gyp\lib\configure.js:443:9
prebuild ERR! stack     at ChildProcess.exithandler (child_process.js:197:7)
prebuild ERR! stack     at emitTwo (events.js:106:13)
prebuild ERR! stack     at ChildProcess.emit (events.js:191:7)
prebuild ERR! stack     at maybeClose (internal/child_process.js:877:16)
prebuild ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
prebuild ERR! not ok

Fortunately I can create an environment with Python 2 easily in Miniconda.

@znmeb
Copy link
Author

znmeb commented Nov 26, 2016

With Python 2 it installs but with warnings:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\dat\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\dat\node_modules\utp-native):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `prebuild --install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 2

Steps to reproduce:

  1. Install Node.js.
  2. Install Miniconda3 from http://conda.pydata.org/miniconda.html.
  3. Open the Anaconda command prompt.
  4. conda create --name=dat python=2.7.
  5. activate dat.
  6. npm install -g dat.

@juliangruber
Copy link
Collaborator

There's three things to say here:

  1. Unfortunately basically any native nodejs dependency on windows will require you to have Python 2 installed and set up correctly.
  2. There's a way around this: To provide a prebuilt binary for each native dependency. The rabin repository doesn't list one for your setup, that's why it tries to compile and then failed on python. We need to get this fixed, see windows prebuilt missing dat-ecosystem-archive/rabin#12 (my job basically, oops! I'll post updates here)
  3. The warnings are ok, no need to worry about those.

@znmeb
Copy link
Author

znmeb commented Nov 27, 2016

@juliangruber Thanks! I'm neither a Node nor a Python programmer - how come the Node.js Windows installer doesn't carry its own Python 2.7 if it needs it - darn near every other Windows installer that needs Python brings its own copy in. :-(

@joehand
Copy link
Collaborator

joehand commented Dec 10, 2016

We'll fix this with #581.

Dat shouldn't require python.

@joehand joehand closed this as completed Dec 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants