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

How to specify the conda environment in which hydrogen (jupyter) starts? #899

Closed
docsteveharris opened this issue Jun 29, 2017 · 8 comments

Comments

@docsteveharris
Copy link

I have tried working from #501 but can't make any progress.

I have Hydrogen 1.18.0 and want to be able to specify the conda environment that in which I launch my jupyter notebook.

From the command line, I'd do

source activate thisenv
jupyter notebook

How do I achieve the same thing from Hydrogen?

Many thanks

@lgeiger
Copy link
Member

lgeiger commented Jun 29, 2017

Guessing from #501 this should do the job:

source activate thisenv
python -m ipykernel install --user --name thisenv

@lgeiger
Copy link
Member

lgeiger commented Jun 29, 2017

It may also work if you start Atom from the command line after running source activate thisenv but then you can't switch between different envs in Atom.

@docsteveharris
Copy link
Author

Thank you. But where do I put this? It doesn't match the JSON which seems to be required for Kernel specs

@lgeiger
Copy link
Member

lgeiger commented Jun 29, 2017

It doesn't match the JSON which seems to be required for Kernel specs

As long as you have jupyter installed you don't need to manually add kernelspecs inside the Hydrogen settings, we automatically detect installed kernels. You can savely remove any JSON you added to the Hydrogen kernel specs settings.

You can run "Hydrogen: Update Kernels" or restart Atom for the changes to take effect. Next time you want to run Python code you'll be prompted to select the environment you just created.

@lgeiger
Copy link
Member

lgeiger commented Jun 29, 2017

One thing to add: You'll only need to run

source activate thisenv
python -m ipykernel install --user --name thisenv

once in the command line.

@docsteveharris
Copy link
Author

thank you very much! all works.

@lgeiger
Copy link
Member

lgeiger commented Jun 29, 2017

Awesome

@g4nym3de
Copy link

g4nym3de commented Jan 9, 2018

I'm terribly sorry. Turns out I haven't installed ipykernel yet. 'pip install ipykernel' solves the problem and for anyone using anaconda with tensorflow in a separate env and just couldn't live without atom + hydrogen, be sure to check the above wonderful solution by @lgeiger


Thx for the answer but the second line wouldn't work, it says No module named ipykernel
My kernelspec is

{
  "kernelspecs": {
    "python2": {
      "resource_dir": "/Users/spoc/anaconda2/share/jupyter/kernels/python2", 
      "spec": {
        "language": "python", 
        "display_name": "Python 2", 
        "env": {}, 
        "argv": [
          "/Users/spoc/anaconda2/bin/python", 
          "-m", 
          "ipykernel_launcher", 
          "-f", 
          "{connection_file}"
        ]
      }
    }
  }
}

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