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

Bash Kernel do not work #17

Closed
fcrespo82 opened this issue May 21, 2015 · 11 comments
Closed

Bash Kernel do not work #17

fcrespo82 opened this issue May 21, 2015 · 11 comments

Comments

@fcrespo82
Copy link

What did not work?
Bash kernel not found in Atom

What is should do?
Evaluate bash commands in Atom the same way it works for python

Steps to reproduce:

  1. Install Hydrogen and tested that it is working with python kernel
  2. Installed bash_kernel with pip install bash_kernel
  3. Updated the language mapping to {"Shell Script": "bash"}
  4. Restarted Atom from the command line
  5. Tried to run a bash command in Atom, but received a error:
No kernel for language shell script found
Check that the language for this file is set in Atom and that you have a Jupyter kernel installed for it.
@rgbkrk
Copy link
Member

rgbkrk commented May 21, 2015

Looks like atom detects bash as shell script, which is not how the kernel is named.

I think in cases like these the kernel should be selectable, but for some we should have a mapping structure lang->kernel_name.

@willwhitney
Copy link
Collaborator

Nope, he's got it covered with the mapping he specifies. The bash kernel
doesn't put its kernelspec in the normal location, so I'm trying to figure
out where it is.

On Thu, May 21, 2015 at 7:07 PM Kyle Kelley notifications@github.com
wrote:

Looks like atom detects bash as shell script, which is not how the kernel
is named.

I think in cases like these the kernel should be selectable, but for some
we should have a mapping structure lang->kernel_name.


Reply to this email directly or view it on GitHub
#17 (comment)
.

@willwhitney
Copy link
Collaborator

@fcrespo82 What platform are you on?

@fcrespo82
Copy link
Author

Oh, sorry, forgot to mention

OS X Yosemite 10.10.3 (14D136)

@willwhitney
Copy link
Collaborator

This is working for me on the same OS — does the Bash kernel work for you in ipython notebook, and can you check in these directories to see if there's a bash/kernel.json in any of them?

/usr/share/jupyter/kernels
/usr/local/share/jupyter/kernels
~/.ipython/kernels

@fcrespo82
Copy link
Author

Yes, it works on ipython notebook
bash kernel
bash kernel 2

And Yes, there is a bash/kernel.json in /usr/local/share/jupyter/kernels here is the kernel.json file.

@willwhitney
Copy link
Collaborator

Mine looks exactly the same, and I've just copy-pasted your mapping into my settings and it works fine.

Can you pop open the dev tools (View -> Developer -> Toggle developer tools) and then try running some Bash again? It should log out "Available kernels:" and then a list of kernels that it's found.

Also try running JSON.parse(atom.config.get('hydrogen.languageMappings')) in the developer console and see that it gets the language mapping properly.

@fcrespo82
Copy link
Author

When I tried option+command+Return it shows:

Window load time: 1409ms
/Users/fernando/.atom/packages/Hydrogen/lib/kernel-manager.coffee:92 SyntaxError: Unexpected token u {stack: (...), message: "Unexpected token u"}message: "Unexpected token u"stack: (...)get stack: function () { [native code] }set stack: function () { [native code] }__proto__: Error/Users/fernando/.atom/packages/Hydrogen/lib/kernel-manager.coffee:92 module.exports.KernelManager.getLanguageMappings/Users/fernando/.atom/packages/Hydrogen/lib/kernel-manager.coffee:76 module.exports.KernelManager.getTrueLanguage/Users/fernando/.atom/packages/Hydrogen/lib/kernel-manager.coffee:34 (anonymous function)/Applications/Atom.app/Contents/Resources/app.asar/node_modules/babel-core/node_modules/lodash/inde…:1413 arrayMap/Applications/Atom.app/Contents/Resources/app.asar/node_modules/babel-core/node_modules/lodash/inde…:6662 map/Users/fernando/.atom/packages/Hydrogen/lib/kernel-manager.coffee:32 module.exports.KernelManager.getAvailableKernels/Users/fernando/.atom/packages/Hydrogen/lib/autocomplete-provider.coffee:10 (anonymous function)/Users/fernando/.atom/packages/Hydrogen/lib/autocomplete-provider.coffee:57 (anonymous function)/Users/fernando/.atom/packages/Hydrogen/lib/autocomplete-provider.coffee:59 (anonymous function)module.js:452 Module._compile/Applications/Atom.app/Contents/Resources/app.asar/node_modules/coffee-cash/lib/coffee-cash.js:85 requireCoffeeScriptmodule.js:347 Module.loadmodule.js:302 Module._loadmodule.js:357 Module.requiremodule.js:376 require/Users/fernando/.atom/packages/Hydrogen/lib/main.coffee:20 (anonymous function)/Users/fernando/.atom/packages/Hydrogen/lib/main.coffee:337 (anonymous function)module.js:452 Module._compile/Applications/Atom.app/Contents/Resources/app.asar/node_modules/coffee-cash/lib/coffee-cash.js:85 requireCoffeeScriptmodule.js:347 Module.loadmodule.js:302 Module._loadmodule.js:357 Module.requiremodule.js:376 require/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:709 module.exports.Package.requireMainModule/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:255 module.exports.Package.activateConfig/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:234 module.exports.Package.activateNow/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:772 (anonymous function)/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:82 module.exports.Emitter.emit/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:219 module.exports.CommandRegistry.handleCommandEvent/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3 (anonymous function)/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:519 module.exports.KeymapManager.dispatchCommandEvent/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:354 module.exports.KeymapManager.handleKeyboardEvent/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:178 module.exports.WindowEventHandler.onKeydown
/Users/fernando/.atom/packages/Hydrogen/lib/main.coffee:87 Updating current editor to: Object {softTabs: true, displayBuffer: Object, mini: undefined, placeholderText: undefined, handleMarkerCreated: function…}
/Users/fernando/.atom/packages/Hydrogen/lib/kernel-manager.coffee:92 SyntaxError: Unexpected token u {stack: (...), message: "Unexpected token u"}
/Users/fernando/.atom/packages/Hydrogen/lib/main.coffee:66 making status bar
/Users/fernando/.atom/packages/Hydrogen/lib/kernel-manager.coffee:92 SyntaxError: Unexpected token u {stack: (...), message: "Unexpected token u"}
/Users/fernando/.atom/packages/Hydrogen/lib/kernel-manager.coffee:99 Available kernels: [Object, Object, unique: function]
/Users/fernando/.atom/packages/Hydrogen/lib/kernel-manager.coffee:92 SyntaxError: Unexpected token u {stack: (...), message: "Unexpected token u"}

And when I run JSON.parse(atom.config.get('hydrogen.languageMappings')) I get:

(program):1 Uncaught SyntaxError: Unexpected token umessage: "Unexpected token u"stack: (...)get stack: function () { [native code] }set stack: function () { [native code] }arguments: nullcaller: nulllength: 1name: ""prototype: StackTraceSetter__proto__: function Empty() {}<function scope>__proto__: ErrorVM508:2 (anonymous function)VM450:847 InjectedScript._evaluateOnVM450:780 InjectedScript._evaluateAndWrapVM450:646 InjectedScript.evaluate

BUT, I think I got it (And it worked when I changed in the coffee file), when I run JSON.parse(atom.config.get('Hydrogen.languageMappings')) with capital H, I get the expected output:

Object {Shell Script: "bash"}

bash kernel 3

@willwhitney
Copy link
Collaborator

Awesome, thanks for your debugging help. I had it installed via symlink (with a lowercase name) to my working directory, so I didn't see this.

Should be fixed now!

@fcrespo82
Copy link
Author

Thank you! Yes, its working now!

@willwhitney
Copy link
Collaborator

Awesome! Thanks for the help debugging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants