n-riesco / ijavascript

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

Ijs startup command doesn't works #98

Closed tesseslol closed 7 years ago

tesseslol commented 7 years ago

ijs Error running jupyter kernelspec install --replace C:\Users\TESSAR~1\AppData\Local\Temp\55c10d7325f3036cc71ab1489f2feeca\javascript --user Error: Command failed: jupyter kernelspec install --replace C:\Users\TESSAR~1\AppData\Local\Temp\55c10d7325f3036cc71ab1489f2feeca\javascript --user Traceback (most recent call last): File "d:\program files\python36\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "d:\program files\python36\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "D:\Program Files\Python36\Scripts\jupyter.exe__main__.py", line 9, in File "C:\Users\Tessari Davide\Anaconda3\Lib\site-packages\jupyter_core\command.py", line 186, in main _execvp(command, sys.argv[1:]) File "C:\Users\Tessari Davide\Anaconda3\Lib\site-packages\jupyter_core\command.py", line 104, in _execvp raise OSError('%r not found' % cmd, errno.ENOENT) OSError: [Errno 'jupyter-kernelspec' not found] 2

Traceback (most recent call last): File "d:\program files\python36\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "d:\program files\python36\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "D:\Program Files\Python36\Scripts\jupyter.exe__main__.py", line 9, in File "C:\Users\Tessari Davide\Anaconda3\Lib\site-packages\jupyter_core\command.py", line 186, in main _execvp(command, sys.argv[1:]) File "C:\Users\Tessari Davide\Anaconda3\Lib\site-packages\jupyter_core\command.py", line 104, in _execvp raise OSError('%r not found' % cmd, errno.ENOENT) OSError: [Errno 'jupyter-kernelspec' not found] 2

but with jupyter-kernelspec work

n-riesco commented 7 years ago

@tesseslol Judging by the log, it looks like there are two installations of Python on your computer:

tesseslol commented 7 years ago

\AppData\Roaming\npm\node_modules\ijavascript\bin\ijavascript.js:310 context.version.frontend ^

TypeError: Cannot read property 'frontend' of undefined at C:\Users\Tessari Davide\AppData\Roaming\npm\node_modules\ijavascript\bin\ijavascript.js:310:32 at ChildProcess.exithandler (child_process.js:202:7) at emitTwo (events.js:106:13) at ChildProcess.emit (events.js:191:7) at maybeClose (internal/child_process.js:885:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

n-riesco commented 7 years ago

@tesseslol Thanks for that log. I'll fix the error message. But note that fixing the error message won't fix the issue in your computer.

n-riesco commented 7 years ago

I've fixed the error messages in master. To install IJavascript from master, run:

npm install -g git+https://github.com/n-riesco/ijavascript.git
tesseslol commented 7 years ago

This is the result of ijs command with the version on master:

Error parsing Jupyter version:
n-riesco commented 7 years ago

@tesseslol What do you get when you run jupyter --version?

tesseslol commented 7 years ago

@n-riesco When i lunch this command an instance of atom is opening. I think there is some problems with hydrogen package for atom.

Video: https://youtu.be/wcGeAKE-yeM

n-riesco commented 7 years ago

@tesseslol I still suspect there is a problem with the installation of jupyter. Could you run the following in a Python console?

In [1]: from jupyter_core.version import __version__

In [2]: __version__
Out[2]: '4.3.0'
n-riesco commented 7 years ago

Also, running the following in the Windows prompt may give us more info:

C:\> where jupyter
tesseslol commented 7 years ago

@n-riesco
1° command:

C:\Users\Tessari Davide>python
Python 3.6.0 |Anaconda 4.3.0 (64-bit)| (default, Dec 23 2016, 11:57:41) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from jupyter_core.version import __version__
>>> __version__
' 4.2.1'

2° command:

C:\Users\Tessari Davide>where jupyter
C:\Users\Tessari Davide\Anaconda3\Lib\site-packages\jupyter.py
C:\Users\Tessari Davide\Anaconda3\Scripts\jupyter.exe
n-riesco commented 7 years ago

I've just watched the video. It looks like your machine is configured to open python files using Atom. I'm not sure why that happens when you run jupyter from the command line.

Are you affected by this issue?

n-riesco commented 7 years ago

Does the following work?

"C:\Users\Tessari Davide\Anaconda3\Scripts\jupyter.exe" --version
tesseslol commented 7 years ago

@n-riesco yes work

n-riesco commented 7 years ago

Not sure it'll work, but you could try to define a macro before running ijs. Like this:

doskey jupyter=jupyter.exe $*

But this is really just a quick patch. The underlying issue is that jupyter.py is opened by Atom, instead of run by python.exe.

tesseslol commented 7 years ago

Work !!! thz