Hydrogen: How to specify the conda environment in which hydrogen (jupyter) starts?

Created on 29 Jun 2017  路  8Comments  路  Source: nteract/hydrogen

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

Most helpful comment

Guessing from #501 this should do the job:

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

All 8 comments

Guessing from #501 this should do the job:

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

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.

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

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.

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.

thank you very much! all works.

Awesome

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}"
        ]
      }
    }
  }
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Mike-MU10 picture Mike-MU10  路  4Comments

olegantonyan picture olegantonyan  路  3Comments

mda6 picture mda6  路  3Comments

xmen1412 picture xmen1412  路  3Comments

ethan92429 picture ethan92429  路  3Comments