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

Kernel spec produced for Windows is invalid #19

Closed
jjkavalam opened this issue Aug 13, 2018 · 3 comments
Closed

Kernel spec produced for Windows is invalid #19

jjkavalam opened this issue Aug 13, 2018 · 3 comments
Assignees
Labels
bug Installation and functionality issues

Comments

@jjkavalam
Copy link

System requirements

  • Windows (Mine is Windows 10, this problem must be there for any Windows version)

Steps to reproduce

  • Clone the repository and run gradlew install
  • After that from suitable command prompt such as the 'Anaconda prompt' run jupyter kernelspec list

Error

(base) D:\jupyter-kernels\kotlin-jupyter>jupyter kernelspec list
[ListKernelSpecs] WARNING | Error loading kernelspec 'kotlin'
Traceback (most recent call last):
  File "D:\Anaconda3\lib\site-packages\jupyter_client\kernelspec.py", line 258, in get_all_specs
    spec = self._get_kernel_spec_by_name(kname, resource_dir)
  File "D:\Anaconda3\lib\site-packages\jupyter_client\kernelspec.py", line 201, in _get_kernel_spec_by_name
    return self.kernel_spec_class.from_resource_dir(resource_dir)
  File "D:\Anaconda3\lib\site-packages\jupyter_client\kernelspec.py", line 47, in from_resource_dir
    kernel_dict = json.load(f)
  File "D:\Anaconda3\lib\json\__init__.py", line 299, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "D:\Anaconda3\lib\json\__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "D:\Anaconda3\lib\json\decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "D:\Anaconda3\lib\json\decoder.py", line 355, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid \escape: line 2 column 32 (char 33)
Available kernels:
  kotlin        C:\Users\jjkav\.ipython\kernels\kotlin
  javascript    C:\Users\jjkav\AppData\Roaming\jupyter\kernels\javascript
  python3       D:\Anaconda3\share\jupyter\kernels\python3

As can be seen there is an issue with the kernel.json installed by kotlin-jupyter:

json.decoder.JSONDecodeError: Invalid \escape: line 2 column 32 (char 33)
jjkavalam added a commit to jjkavalam/kotlin-jupyter that referenced this issue Aug 13, 2018
@sciencegirl100
Copy link

sciencegirl100 commented Mar 6, 2019

Even after trying to replace \ with \\ it still fails for me.

[W 19:25:28.771 NotebookApp] Error loading kernelspec 'kotlin' Traceback (most recent call last): File "C:\Users\scien\Anaconda3\lib\site-packages\jupyter_client\kernelspec.py", line 258, in get_all_specs spec = self._get_kernel_spec_by_name(kname, resource_dir) File "C:\Users\scien\Anaconda3\lib\site-packages\jupyter_client\kernelspec.py", line 201, in _get_kernel_spec_by_name return self.kernel_spec_class.from_resource_dir(resource_dir) File "C:\Users\scien\Anaconda3\lib\site-packages\jupyter_client\kernelspec.py", line 47, in from_resource_dir kernel_dict = json.load(f) File "C:\Users\scien\Anaconda3\lib\json\__init__.py", line 296, in load parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) File "C:\Users\scien\Anaconda3\lib\json\__init__.py", line 348, in loads return _default_decoder.decode(s) File "C:\Users\scien\Anaconda3\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Users\scien\Anaconda3\lib\json\decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Invalid \escape: line 2 column 32 (char 33)

@altavir
Copy link
Contributor

altavir commented Dec 7, 2019

Seems to be working now on Win10. Close?

@ileasile
Copy link
Collaborator

ileasile commented Dec 7, 2019

Issue was fixed with this commit: f127118

Note that it's not obvious where Jupyter finds kernel spec it tries to run. For more information look into this: https://jupyter-client.readthedocs.io/en/stable/kernels.html#kernel-specs

If you're still having troubles, old kernel spec in some other path may be the reason. In my case, it was old spec in ~\AppData\Roaming\jupyter\kernels\kotlin. To fix it, you may specify the path to this spec in gradle.properties, and then re-install the kernel.

If it doesn't help, feel free to open a new issue.

@ileasile ileasile closed this as completed Dec 7, 2019
@ileasile ileasile added the bug Installation and functionality issues label Dec 7, 2019
@ileasile ileasile self-assigned this Dec 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Installation and functionality issues
Projects
None yet
Development

No branches or pull requests

4 participants