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

Failed to build with python2 is a batch file #750

Closed
jixunmoe opened this issue Sep 30, 2015 · 5 comments
Closed

Failed to build with python2 is a batch file #750

jixunmoe opened this issue Sep 30, 2015 · 5 comments

Comments

@jixunmoe
Copy link

gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` succeeded python2 D:\bin\python2.CMD
gyp ERR! configure error
gyp ERR! stack Error: spawn python2 ENOENT
gyp ERR! stack     at exports._errnoException (util.js:814:11)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
gyp ERR! stack     at onErrorNT (internal/child_process.js:344:16)
gyp ERR! stack     at doNTCallback2 (node.js:430:9)
gyp ERR! stack     at process._tickCallback (node.js:344:17)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "C:\\PROGRAM FILES\\IOJS\\node.exe" "C:\\Program Files\\iojs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\xyz\node_modules\irc\node_modules\node-icu-charset-detector
gyp ERR! node -v v2.4.0
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok

The content of my python2.cmd is:

@C:\Python27\Python.exe %*

Suggestion: Able to read from a environment variable first, such as PYTHON2_PATH?
I don't mind set up those variable manually.

@jbergstroem
Copy link
Member

We had a similar issue in node; needs to use call, right?

@jixunmoe
Copy link
Author

I'm not familiar with call, so I just workaround it by read the environment variable:

  // Some code ...

  // Check if Python is in the $PATH
  function checkPython () {
    if (process.env.PYTHON2_PATH) {
      python = process.env.PYTHON2_PATH
      log.verbose('use python from env', '$PYTHON2_PATH => %s', python)
      return checkPythonVersion()
    }

  // Some code ...

If you mean the batch file to execute another batch file, then you do need to use call to ensure that, when the target script exit, it know where to continue.

@jbergstroem
Copy link
Member

try editing where the call to python is made in the windows-specific part and add call in front of it. See: nodejs/node#2594

@jixunmoe
Copy link
Author

I see what you mean now.. But in this case it doesn't apply because my C:\Python27\Python.exe is the actual executable file.

I should've said this error was occurred when, I was try to install a module, using npm install irc --save.

@orangemocha
Copy link
Contributor

gyp ERR! stack Error: spawn python2 ENOENT

Depending on how it's trying to spawn, it might not be able to launch a batch file.

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