Use Atom's Hydrogen package with Conda environments in WSL

825 Views Asked by At

I was trying to setup WSL for Deep Learning/Machine Learning. I have installed Conda environment via WSL. Now I am wondering is there any way to setup atom's hydrogen package to detect conda environments with ipykernels, which are in WSL?

System:

  • Windows 10
  • Ubuntu 18.04 LTS
  • Miniconda for python 3.7(installed in /home/)

Already Tried:

  • using python -m ipykernel install --user --name envName

Thanks

1

There are 1 best solutions below

0
On

I got it working by setting up a Hydrogen Remote Host.

  • You need to add the following to the getaways list in Hydrogen's settings:
[{
  "name": "WSL",
  "options": {
    "baseUrl": "http://127.0.0.1:8888",
    "token": "your_secret_token"
  }
}]
  • Then set up a public jupyter server with an empty password as explained in the instructions.

  • In WSL run: jupyter notebook --generate-config and modify the file ~/.jupyter/jupyter_notebook_config.py changing the line c.NotebookApp.token = 'your_secret_token'

  • Always in WSL run jupyter lab open it in your browser at localhost:8888 and set an empty password (everybody in your network, and also people outside of it in case you are not behind a firewall, will be able to execute code on your machine if they access to the jupyter server, so be aware of this)

  • Start a notebook with the desired kernel.

  • Open Atom > Packages > Hydrogen > Connect to Remote Host

  • You should now be able to select WSL and then as a session, the notebook you started earlier.

Sometimes nothing happens when you click on 'Connect to Remote Host', in that case just retry, eventually it should show up.