Skip to content

Instantly share code, notes, and snippets.

@josemarcosrf
Created June 7, 2020 15:09
Show Gist options
  • Select an option

  • Save josemarcosrf/7fff9ddea6f799a1a0bf5809c0982715 to your computer and use it in GitHub Desktop.

Select an option

Save josemarcosrf/7fff9ddea6f799a1a0bf5809c0982715 to your computer and use it in GitHub Desktop.
Jupyter Kernel with virtual env or conda envs

For jupyter notebooks to identify your virtual env kernels:

  1. Activate your env and install ipykernel:
pip install --user ipykernel
  1. Add your virtual environment to Jupyter:
python -m ipykernel install --user --name=myenv

And you should see:

Installed kernelspec myenv in /home/user/.local/share/jupyter/kernels/myenv

kernel.json:

{
 "argv": [
  "/home/user/anaconda3/envs/myenv/bin/python",
  "-m",
  "ipykernel_launcher",
  "-f",
  "{connection_file}"
 ],
 "display_name": "myenv",
 "language": "python"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment