Closed Adityammv closed 5 years ago
You need to install Python v2.7 to be able to run node-gyp
. Please, see issue #184.
Closing in favour of #184
Thanks @n-riesco . It seems like the steps mentioned in the documentation is for fresh install. What are the steps that we would need to follow for Mac os in case if we have python 2.7, npm and other node dependancies already.
@Adityammv After installing python 2.7, do you get the same error when you run npm install -g ijavascript
?
@n-riesco I have uninstalled python 3.7 completely and installed 2.7 and when I run npm install -g ijavascript it is still looking for python 3.7 executable file.
Requested to use external libzmq. Skipping libzmq build
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python3.7", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython
(/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:484:19)
gyp ERR! stack at PythonFinder.node scripts/prebuild-install.js || (node scripts/preinstall.js && node-gyp rebuild)
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the zeromq@4.6.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in: npm ERR! /Users/adityamutyala/.npm/_logs/2019-01-15T23_26_34_274Z-debug.log
Any help on this much appreciated.
Thanks!
@Adityammv No need to uninstall python 3 (python 2 and 3 can live together).
What do you get when you run npm config get python
and python --version
?
Thanks @n-riesco This is what I got. Adityas-MacBook-Pro-2:~ adityamutyala$ npm config get python python3.7 Adityas-MacBook-Pro-2:~ adityamutyala$ python --version Python 2.7.10
Does this mean I would need to uninstall npm and reinstall npm?
@Adityammv npm config delete python
should fix your issue.
Thanks @n-riesco i have used npm config set python python2.7 and then npm config delete python command and it resolved that error. But now when i ran npm install -g ijavascript ijsinstall I got following
Adityas-MacBook-Pro-2:~ adityamutyala$ npm install -g ijavascript ijsinstall npm ERR! code E404 npm ERR! 404 Not Found: ijsinstall@latest
Should i mirror or clone the latest ijavascript git package to fix this issue?
@Adityammv There's only package ijavascript! :smile:
The command to install IJavascript is npm install -g ijavascript
.
To be able to use IJavascript with the Jupyter notebook and similar frontends, you also need to install IJavascript's kernelspec by running the command ijsinstall
.
ijsinstall
is one of the commands provided by ijavascript.
Adityas-MacBook-Pro-2:~ adityamutyala$ npm install -g ijavascript
[...]
Adityas-MacBook-Pro-2:~ adityamutyala$ ijsinstall
Adityas-MacBook-Pro-2:~ adityamutyala$
Gotcha. Thanks @n-riesco I was able to install javascript successfully. But I run kernel command ijsinstall. I'm getting command not found error.
Adityas-MacBook-Pro-2:~ adityamutyala$ npm install -g ijavascript /Users/adityamutyala/.npm-packages/bin/ijs -> /Users/adityamutyala/.npm-packages/lib/node_modules/ijavascript/bin/ijavascript.js /Users/adityamutyala/.npm-packages/bin/ijsinstall -> /Users/adityamutyala/.npm-packages/lib/node_modules/ijavascript/bin/ijsinstall.js /Users/adityamutyala/.npm-packages/bin/ijsconsole -> /Users/adityamutyala/.npm-packages/lib/node_modules/ijavascript/bin/ijsconsole.js /Users/adityamutyala/.npm-packages/bin/ijsnotebook -> /Users/adityamutyala/.npm-packages/lib/node_modules/ijavascript/bin/ijsnotebook.js /Users/adityamutyala/.npm-packages/bin/ijskernel -> /Users/adityamutyala/.npm-packages/lib/node_modules/ijavascript/lib/kernel.js
@Adityammv What's the output of running npm config get prefix
?
I get this as output Adityas-MacBook-Pro-2:~ adityamutyala$ npm config get prefix /Users/adityamutyala/.npm-packages
If I install kernel manually as specified in https://github.com/n-riesco/ijavascript/issues/148 resolve this issue?
@Adityammv That means ijsinstall
is installed in folder /Users/adityamutyala/.npm-packages/bin
and this folder is not listed in your PATH
.
If that's the case, you'll need to install the kernelspec with full paths, like this:
/Users/adityamutyala/.npm-packages/bin/ijsinstall --spec-path=full
Gotcha. That worked!
Thanks a lot. I appreciate your help @n-riesco .
In Macos While executing npm install -g ijavascript i got the following error. I.e. node-gyp.js rebuild failed error.
gyp ERR! configure error gyp ERR! stack Error: Command failed: /Users/user_a/anaconda3/bin/python3.7 -c import sys; print "%s.%s.%s" % sys.version_info[:3]; gyp ERR! stack File "", line 1
gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:294:12)
gyp ERR! stack at ChildProcess.emit (events.js:188:13)
gyp ERR! stack at maybeClose (internal/child_process.js:978:16)
gyp ERR! stack at Socket.stream.socket.on (internal/child_process.js:395:11)
gyp ERR! stack at Socket.emit (events.js:188:13)
gyp ERR! stack at Pipe._handle.close (net.js:610:12)
gyp ERR! System Darwin 18.2.0
gyp ERR! command "/usr/local/Cellar/node/11.6.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/adityamutyala/.npm-packages/lib/node_modules/ijavascript/node_modules/zeromq
gyp ERR! node -v v11.6.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! zeromq@4.6.0 install:
node scripts/prebuild-install.js || (node scripts/preinstall.js && node-gyp rebuild)
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the zeromq@4.6.0 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm ERR! A complete log of this run can be found in: npm ERR! /Users/adityamutyala/.npm/_logs/2019-01-14T19_41_04_202Z-debug.log
Can you please help me with this issue.