Giter VIP home page Giter VIP logo

Comments (46)

slavaGanzin avatar slavaGanzin commented on June 22, 2024 1

@hugeme
ln -s /usr/local/share/kernels/python2 ~/.ipython/kernels
Try this.

It's a bug fixed here: #144
If hydrogen can't to interpret all folders as kernels it fails and return no kernels at all.

from hydrogen.

slavaGanzin avatar slavaGanzin commented on June 22, 2024 1

@hugeme Generally I don't know how to install kernels properly on MacOS. So you can look here:
But as I remember this should work: sudo python3 -m IPython kernelspec install-self.

Please copy output of jupyter --paths for investigation purposes.

You have python kernel in a list because it was shamelessly hardcoded. So hydrogen may not founding it.


To fix #135 you should reinstall hydrogen as a regular user and then apm rebuild

from hydrogen.

rgbkrk avatar rgbkrk commented on June 22, 2024

This may be related to other path and kernel search issues, which might be addressed in #19. I'm assuming arch uses the XDG directories and env variables?

from hydrogen.

willwhitney avatar willwhitney commented on June 22, 2024

This is a fine place to ask!

Hydrogen doesn't start a kernel until you run something, so if you haven't done a "Hydrogen:run" command yet, the kernel won't show up.

Otherwise, did you start Atom from the command line? If not, it can't see your $PATH.

Let me know if neither of those solves it and we'll try to figure out the problem.

from hydrogen.

Ardelean-Calin avatar Ardelean-Calin commented on June 22, 2024

willwhiteney, yes, I have run it from the command line. When I run hydrogen it shows the following near the line of code, however nothing happens:
image

rgbkrk, I'll check out that link after I document myself what arch uses.

Do I need to build Jupyter, even though I have installed IPython from the arch package manager? If so, what do I need to build more exactly?

from hydrogen.

rgbkrk avatar rgbkrk commented on June 22, 2024

Jupyter is just the next release. Which version of IPython are you on?

from hydrogen.

Ardelean-Calin avatar Ardelean-Calin commented on June 22, 2024

Python 3.4.3 and IPython 3.1.0. Although I also have Python 2.7.9 and its respective IPython (3.1.0) installed.

from hydrogen.

rgbkrk avatar rgbkrk commented on June 22, 2024

Can you run

from IPython.utils.path import get_ipython_dir; get_ipython_dir()

in a python or IPython terminal?

from hydrogen.

Ardelean-Calin avatar Ardelean-Calin commented on June 22, 2024

Sure, sorry for the delay:

Out[1]: '/home/calin/.ipython'

That's what I get.

from hydrogen.

willwhitney avatar willwhitney commented on June 22, 2024

@acpcalin I log a bunch of stuff out to the console to help debug this sort of thing — mind updating to the latest version, then opening the dev console (View -> Developer -> Toggle Developer Tools) and trying to run something? It should spit out launching kernel: followed by the command and arguments it's using to try to start the kernel, along with any errors.

from hydrogen.

Ardelean-Calin avatar Ardelean-Calin commented on June 22, 2024
launching kernel: ipython ["kernel", "--no-secure", "--hb=47608", "--control=50748", "--shell=35255", "--stdin=41349", "--iopub=46541", "--colors=NoColor"]

image

from hydrogen.

willwhitney avatar willwhitney commented on June 22, 2024

If you leave it waiting for a response, then run that command in your terminal (ipython kernel --no-secure --hb=47608 --control=50748 --shell=35255 --stdin=41349 --iopub=46541 --colors=NoColor) then it should resolve the result, yes?

Does process.env.PATH looks right in the Atom console? It could be that Atom is somehow failing to get the PATH properly.

from hydrogen.

Ardelean-Calin avatar Ardelean-Calin commented on June 22, 2024

Where do I find this entry in the Atom console?
EDIT: nevermind, found it, I needed to execute that command. It says "undefined".
And no, running that command doesn't do it unfortunately.
Maybe it's because I manually built Atom? Maybe I should have installed it from the Arch User Repository with root privileges?

from hydrogen.

willwhitney avatar willwhitney commented on June 22, 2024

Ooh, that's probably the culprit. Investigating...

from hydrogen.

Ardelean-Calin avatar Ardelean-Calin commented on June 22, 2024

No, sorry. Actually the output is

"/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:~/.atom"

I didn't know that command was case-sensitive, I am sorry.

from hydrogen.

willwhitney avatar willwhitney commented on June 22, 2024

OK, cool. Now try running cp.spawnSync('ipython', ['--version']).stdout.toString() in the Atom console.

from hydrogen.

Ardelean-Calin avatar Ardelean-Calin commented on June 22, 2024

image

from hydrogen.

willwhitney avatar willwhitney commented on June 22, 2024

Whoops. Run cp = require('child_process') first, sorry about that.

from hydrogen.

Ardelean-Calin avatar Ardelean-Calin commented on June 22, 2024

No problem.
image

from hydrogen.

willwhitney avatar willwhitney commented on June 22, 2024

OK, so it's definitely able to find your ipython install.

Try running something with Hydrogen, then while it's failing to give you a result, flip over to the terminal and running ipython kernel --no-secure --hb=47608 --control=50748 --shell=35255 --stdin=41349 --iopub=46541 --colors=NoColor (and substitute for the ports that Hydrogen has printed in the "launching kernel" message if they're different).

from hydrogen.

Ardelean-Calin avatar Ardelean-Calin commented on June 22, 2024

Ok, this is weird. I didn't run that command yet, because the problem seems to be fixed now. I don't know why or how, however. I'll tell you step by step what I have done: First I tried to run Atom as root (sudo atom) and noticed that the root profile didn't have Hydrogen installed, even though I installed it in Atom on my normal, non-root, account. Then I tried installing Hydrogen as root (sudo PYTHON=python2 apm install hydrogen). This way it tried to install somewhere in the .root folder so that it would show up when I ran Atom with sudo. It failed with an error code(I closed the window, unfortunately).
Now, however, Hydrogen works on my normal profile. After I select Hydrogen:Run, it takes 1 second until it detects the IPython kernel and then it works just as expected.
image

from hydrogen.

willwhitney avatar willwhitney commented on June 22, 2024

Yup, that's bizarre. I'm glad it's working for you now!

Is it possible that this was just a side effect of restarting Atom?

from hydrogen.

Ardelean-Calin avatar Ardelean-Calin commented on June 22, 2024

I don't really know, maybe. Thanks for the help!

from hydrogen.

Ardelean-Calin avatar Ardelean-Calin commented on June 22, 2024

I just realized, sometimes Hydrogen finds the kernel, sometimes it doesn't. Closing and opening Atom several times and trying to run Hydrogen after each time is the solution. I don't know why, but I'm glad it works now.

from hydrogen.

willwhitney avatar willwhitney commented on June 22, 2024

That's very weird. I wouldn't be surprised if it's an issue of the kernel
failing to get started rather than it not being found.

I just published a version with a little more logging of what the kernel
process is doing, so if it keeps being unreliable, you can check out the
new logs and maybe see what's happening.

On Sun, May 24, 2015 at 3:51 PM acpcalin [email protected] wrote:

I just realized, sometimes Hydrogen finds the kernel, sometimes it
doesn't. Closing and opening Atom several times and trying to run Hydrogen
after each time is the solution. I don't know why, but I'm glad it works
now.


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

from hydrogen.

 avatar commented on June 22, 2024

May I jump in? Having the same issue, that the kernel is not displayed in the bottom left. And I'm not able to find anything related to that topic but that entry here.

from hydrogen.

 avatar commented on June 22, 2024

@terraqout Thank you for that suggestion. However, I dont have that path /usr/local/share/kernels/python2.(and after trying that the issue remains)

sudo find / -type d -name 'kernels' gives back:
Users/me/Library/Jupyter/kernels
/usr/local/lib/python2.7/site-packages/notebook/services/kernels
/usr/local/lib/python2.7/site-packages/notebook/static/services/kernels
/Users/me/Library/Jupyter/kernels
/usr/local/lib/python2.7/site-packages/notebook/services/kernels
/usr/local/lib/python2.7/site-packages/notebook/static/services/kernels

and none of them contains python2.
Additionally, I used brew /usr/local/Cellar/python/2.7.11/share/python

Not sure whether that matters but hydrogen is not listed in installed packages within atom. But I can still Hydrogen:run. Additionally sudo atom and Hydrogen:run results #135. atomin command line results in #135 as well now.

from hydrogen.

slavaGanzin avatar slavaGanzin commented on June 22, 2024

@hugeme And besides, I would appreciate if you experiment with #144 on the same setup before any "fixing".

cd to/your/.atom/packages
rm Hydrogen -rf
git clone [email protected]:willwhitney/hydrogen.git
cd hydrogen
git checkout kernelManagerImpove
apm rebuild

If it would fix your issue, I'll merge it in master.

from hydrogen.

 avatar commented on June 22, 2024

@terraqout #135 seems to be fixed, I'll get again In the right upper corner a blue box with "Scopes at Cursor"
Next:
The jupyter --paths are:
config:

`/Users/me/.jupyter
/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/etc/jupyter
/usr/local/etc/jupyter
/etc/jupyter`

data:
/Users/me/Library/Jupyter /usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/share/jupyter /usr/local/share/jupyter /usr/share/jupyter
runtime:
/Users/me/Library/Jupyter/runtime

Next:
I run what you have suggested which ends with apm rebuild without any errors. Restarting atom from command line and Hydrogen:runresults in a new error. Red box similar to the At Could not find module root given file: "undefined". Do you have a package.jsonfile? I'll get cannot find module zmq and referring to #135 again

from hydrogen.

slavaGanzin avatar slavaGanzin commented on June 22, 2024

That's ok — Red box is kernel error, so install zmq as described here: https://github.com/willwhitney/hydrogen#os-x and retry.

thanks for jupyter --paths

from hydrogen.

 avatar commented on June 22, 2024

Do you mean that part?:
brew install pkg-config

brew install zeromq
Both are already brewed/installed. Just reinstalled with same error refering to zmq. Just a side note. Ipython is running via Jupiter without any problems using python2

from hydrogen.

slavaGanzin avatar slavaGanzin commented on June 22, 2024

Jupyter needs zmq for python2, you may have zmq for third.

Try pip2 install zmq or if your python defaults to second version just pip install zmq.

from hydrogen.

 avatar commented on June 22, 2024

reinstall zmq via pip but with the same error in atom.

Not sure whether its related, but in the upper comment a question is about the output of:

from IPython.utils.path import get_ipython_dir; get_ipython_dir() when running that via Jupiter I'll get:

/usr/local/lib/python2.7/site-packages/IPython/utils/path.py:258: UserWarning: get_ipython_dir has moved to the IPython.paths module warn("get_ipython_dir has moved to the IPython.paths module")

from hydrogen.

slavaGanzin avatar slavaGanzin commented on June 22, 2024

So your kernel isn't in default folder

what is placed here: /usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/etc/jupyter

?

from hydrogen.

 avatar commented on June 22, 2024

That ends here:

/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7

Headers Resources include
Python bin lib

from hydrogen.

slavaGanzin avatar slavaGanzin commented on June 22, 2024

Looks like you have the same issue #142

from hydrogen.

slavaGanzin avatar slavaGanzin commented on June 22, 2024

Drop your zeromq and try to install other way. It should help :)

from hydrogen.

 avatar commented on June 22, 2024

Thank you! Thats it! "other way around" solved it!

from hydrogen.

slavaGanzin avatar slavaGanzin commented on June 22, 2024

@hugeme Can you explain your experience. So we can add this to readme.md?

from hydrogen.

ssahaxd avatar ssahaxd commented on June 22, 2024

Solution

Just make sure, Python is installed for all users and it is added to the environment variables.

ss1

python setup Wizard
I was also facing the same problem, after adding it to the environment all my problems were solved.

from hydrogen.

BenRussert avatar BenRussert commented on June 22, 2024

@ssahaxd are you interested in making a contribution about this to our docs installation page? The environment variables issue comes up frequently from windows users.

Edit: or the Troubleshooting page

from hydrogen.

ssahaxd avatar ssahaxd commented on June 22, 2024

@BenRussert of course, I would like to contribute.
where the detailed article I should post?
Troubleshooting page looks a great spot.

from hydrogen.

BenRussert avatar BenRussert commented on June 22, 2024

That's great!

Troubleshooting page looks a great spot.

I agree, especially if you want to go into detail.

from hydrogen.

ssahaxd avatar ssahaxd commented on June 22, 2024

@BenRussert
added and created a pull request.

from hydrogen.

BenRussert avatar BenRussert commented on June 22, 2024

@ssahaxd thanks again!

from hydrogen.

rgbkrk avatar rgbkrk commented on June 22, 2024

That is so crazy that the Windows installer doesn't include Python on the path by default. O___O

from hydrogen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.