n-riesco / ijavascript

IJavascript is a javascript kernel for the Jupyter notebook
Other
2.18k stars 187 forks source link

Give a documented dependency install on Linux (ubuntu) #270

Open nirvaan97 opened 2 years ago

nirvaan97 commented 2 years ago

I been trying to install ijavascript on my machine which is running ubuntu 20.04 lts but , i already have installed jupyter-lab via pip and have snap package for node 16x and npm 8x but still when i installed ijavascript except for the uuid error saying it was deprecated , every thing else went without any error, Except when i opened the jupyter lab and tried to use the node kernel it said that no such kernel, i even installed the jupyter package as so mentioned on the first instruction of the ubuntu installation . but still i was not able to use the package.

so please look into this and be kind enough to give a complete dependency resoled installation Thank you.

one more thing the method you mentioned for the windows i was too not able to installl via that

n-riesco commented 2 years ago

Sorry about that!

I opened #245 to remind myself, but this documentation really needs more visibility. The solution is hidden in https://github.com/n-riesco/ijavascript/issues/221#issuecomment-784648092 and the comments of some installation issues.

Basically, iJavascript depends on zeromq (which distributes pre-built binaries for each OS and Node.js version). Unfortunately, zeromq hasn't caught up with the newer versions of Node.js.

Really, I should give more visibility to this issue in the README.

Anyways, for Debian and Ubuntu, the following should do the trick:

sudo apt-get install nodejs npm jupyter libzmq3-dev
npm config set prefix $HOME
npm install -g ijavascript
ijsinstall

In your case, sudo apt-get install libzmq3-dev should be enough, as it sounds like jupyter and node are already installed in your machine.

nirvaan97 commented 2 years ago

problem Sorry to be a bother again but that thing did not help and i don't seem to understand the problem

and again i have

and now with your suggested package i seem to full fill all the requirement but still its not working

n-riesco commented 2 years ago

That error message is telling us that zeromq didn't find the binary for your installation.

My guess would be that IJavascript needs reinstalling to make sure it builds a binary from source:

$ npm uninstall -g ijavascript
$ npm install -g ijavascript
$ ijsinstall

If that doesn't work either, I'd install a kernelspec with full paths, to rule out using a previous installation of IJavascript:

$ ijsinstall --spec-path=full
nirvaan97 commented 2 years ago

sorry to respond this late , but i guess this is not for me as still its giving me the same errors as it was giving me earlier. Even this thing is not installing over the windows10 and there its giving me ERROR 1 from the npm. Thanks by the way for responding so quickly.

n-riesco commented 2 years ago

I'd need to know what command is failing and the error messages to be able to help further (the error number doesn't help me enough).

To build from source in Windows, VS is needed. If you're using VS 2022, see #253 . But again, error logs would help.

nirvaan97 commented 2 years ago

Screenshot (58) just to show what a already have installed Screenshot (60) Screenshot (59) these were the errors i got while installing over the window 10

nirvaan97 commented 2 years ago

Screenshot from 2022-04-22 21-36-17

Screenshot from 2022-04-22 21-36-33 23dda48 Screenshot from 2022-04-22 21-36-37 .png) Screenshot from 2022-04-22 21-36-54

Ubuntu errors

n-riesco commented 2 years ago

In Windows, npm install -g ijavascript fails, because it can't locate an installation of Visual Studio. See here the requirements to build from source.

In Ubuntu, jupyter fails to launch the Ijavascript kernel, because it can't locate the binary for zeromq:

nirvaan97 commented 2 years ago

In Ubuntu, jupyter fails to launch the Ijavascript kernel, because it can't locate the binary for zeromq: How do i solve it cuz i did install it the way you told me earlier

Yeah i did try them but nothing helped.

n-riesco commented 2 years ago

Just to be clear: after running sudo apt-get install libzmq3-dev, you also need to:

Please, let me know if you get any errors when you run npm install -g ijavascript.

If you get no errors and it's still not working, try to install the kernelspec with full paths:

$ ijsinstall --spec-path=full

If it's still not working, please, could you run the following and post the output here?:

$ jupyter kernelspec list --json
$ which ijsinstall
nirvaan97 commented 2 years ago
  1. here i installed sudo apt-get install libzmq3-dev and reinstalled the ijsintall Screenshot from 2022-04-23 00-04-19

  2. Please, let me know if you get any errors when you run npm install -g ijavascript.

    • the only error i ever got was following Screenshot from 2022-04-23 00-04-19
  3. If you get no errors and it's still not working, try to install the kernelspec with full paths: $ ijsinstall --spec-path=full

    • but still got that same no kernel error

Screenshot from 2022-04-23 00-07-40

  1. If it's still not working, please, could you run the following and post the output here?:
$ jupyter kernelspec list --json
$ which ijsinstall

Screenshot from 2022-04-23 00-09-56

n-riesco commented 2 years ago

Sorry: /home/nirvaan/bin/ijsinstall must be a file link. Could you run ll $(which ijsinstall), please? I want to check that it's using the Ijavascript installation in /home/nirvaan/lib/node_modules/ijavascript.

If it does, I can't explain why you didn't see any errors during npm i -g ijavascript (other than the uuid warning). But you could try to rebuild Ijavascript manually, by doing the following:

$ cd /home/nirvaan/lib/node_modules/ijavascript
$ rm -rf /home/nirvaan/lib/node_modules/ijavascript/node_modules
$ npm i

If after this it isn't working, I'll try to reproduce the issue in a VM, but I can't do it today.

nirvaan97 commented 2 years ago
  1. Could you run ll $(which ijsinstall), please? I want to check that it's using the Ijavascript installation in /home/nirvaan/lib/node_modules/ijavascript.

    • i did not get what you meant by Could you runll $(which ijsinstall),
    • i hope it meant going to the directory so i did that Screenshot from 2022-04-23 00-53-13
    • i also ran which ijsinstall which gave following Screenshot from 2022-04-23 00-09-56 owing but that you already know
  2. If after this it isn't working, I'll try to reproduce the issue in a VM, but I can't do it today

    • no worry you take your time . and let me take time to thank you a lot for all the help you are giving, really Thanks a lot.