vickumar1981 / jupyter-dart-kernel

Dart Kernel for Jupyter Notebooks
MIT License
42 stars 5 forks source link

Permission error while installing on Windows 11 #2

Closed taylorren closed 2 years ago

taylorren commented 2 years ago

I would like to give this a try and follow the instruction here to install. The following error was prompted:

Ashampoo_Snap_2022年6月30日_07h30m42s_002_

I checked the current content in that directory and only two logo files there. So I presume it should be OK to delete them manually?

vickumar1981 commented 2 years ago

@taylorren not sure. you might need to run the command as an admin on Windows (this is just a guess).

it is okay to delete the logo files, but i would back them up 1st. it looks like those logo files are for the Julia kernel. The kernel for Dart included in this repo, doesn't have a logo file, so it should just display a "D" as the logo.

vickumar1981 commented 2 years ago

@taylorren let me know if you get this working on Windows. I've tested on Linux and from inside of a docker container.

taylorren commented 2 years ago

Hi @vickumar1981

Thanks for your prompt reply.

I tried to install this kernel. I have deleted any files that are in the above mentioend directory and run the command per your README.

Files are installed and I have the following few files: dartkernel.py, kernel .json, LICENSE, README.md

Issue: When I launch jupyter notebook and open/create a new notebook, the kernel selection does not show "Dart". It shows "Julia" and "Python".

I moved the 4 files above to a new directory called "dart”. Now the "Dart" selection is there but the log window shows:

[I 21:48:46.280 NotebookApp] KernelRestarter: restarting kernel (4/5), new random ports
D:\Python\python.exe: No module named dartkernel

That is all I have so far.

Looking forward to your insights on this.

vickumar1981 commented 2 years ago

what is your output from jupyter kernelspec list? does it list jupyter-dart-kernel?

jupyter kernelspec list lists the kernels you have available for your jupyter notebook.

> jupyter kernelspec list
Available kernels:
  jupyter-dart-kernel     /usr/local/share/jupyter/kernels/jupyter-dart-kernel
  ...

i would 1st try to make sure the kernel installed, before starting jupyter. it's not a command you can/should do while or after your jupyter notebook is already started.

i believe the only two files you need in the directory are dartkernel.py, kernel .json.

i also think you might have to run the command from up one directory: jupyter kernelspec install jupyter-dart-kernel --user.

taylorren commented 2 years ago

Hi Vic, Thanks again.

  1. Installed again the kernel using jupyter kernelspec install jupyter-dart-kernel --user. No issue.

  2. jupyter kernelspec list tells me I have 3 kernels available: julia-1.7, jupyter-dart-kernel (C:\Users\Taylor Ren\AppData\Roaming\jupyter\kernels\jupyter-dart-kernel), python3

  3. jupyter notebook and create a new notebook with Dart as the kernel.

  4. Same error like before


[I 07:33:04.856 NotebookApp] Kernel started: cbef75f2-6090-4831-9227-c92c6afe9ab3, name: jupyter-dart-kernel
D:\Python\python.exe: No module named dartkernel
[I 07:33:07.865 NotebookApp] KernelRestarter: restarting kernel (1/5), new random ports
D:\Python\python.exe: No module named dartkernel
[I 07:33:10.888 NotebookApp] KernelRestarter: restarting kernel (2/5), new random ports
D:\Python\python.exe: No module named dartkernel
[I 07:33:13.910 NotebookApp] KernelRestarter: restarting kernel (3/5), new random ports
D:\Python\python.exe: No module named dartkernel
[I 07:33:16.932 NotebookApp] KernelRestarter: restarting kernel (4/5), new random ports
D:\Python\python.exe: No module named dartkernel
[I 07:33:19.969 NotebookApp] KernelRestarter: restarting kernel (5/5), new random ports
D:\Python\python.exe: No module named dartkernel
[W 07:33:22.994 NotebookApp] KernelRestarter: restart failed
[W 07:33:22.994 NotebookApp] Kernel cbef75f2-6090-4831-9227-c92c6afe9ab3 died, removing from map.

I will try later on my office MBA.

Update: No luck on my MBA. Same error: no kernel named....

vickumar1981 commented 2 years ago

will try on a Windows machine and see what happens...might take me a few days to get a hold of the OS somehow.

vickumar1981 commented 2 years ago

@taylorren tested out on a windows machine and got it working. probably need to update the instructions in the README.md for Windows. from the output, i think the jupyter-dart-kernel is installed right, but the dart executable has to be in the PATH and the location of the dart kernel has to be in the PYTHONPATH.

here's the steps:

1) Make sure dart is installed and accessible via the path. You can check this by opening a terminal / command prompt and typing: dart --version.

2) (this is the step that is missing) Make sure the location of where the jupyter-dart-kernel is installed is in your PYTHONPATH. This is where the python interpreter looks for modules, including the dartkernel.py file.

For your case, I believe you'd have to add C:\Users\Taylor Ren\AppData\Roaming\jupyter\kernels\jupyter-dart-kernel to the PYTHONPATH: https://stackoverflow.com/questions/3701646/how-to-add-to-the-pythonpath-in-windows-so-it-finds-my-modules-packages

let me know if that works for you. thanks.

vickumar1981 commented 2 years ago

@taylorren do those instructions work on your end? if so, i can update the README.md, and close out the issue.

thanks!!!

taylorren commented 2 years ago

Yes, thanks for your support and quick feedback! Much appreciated!

vickumar1981 commented 2 years ago

Updated README instructions: https://github.com/vickumar1981/jupyter-dart-kernel/commit/4cd6821e8edef23cb9dee4c00178be2916bb55c2