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

IPykernel in Poetry not recognised #1859

Closed
2 of 5 tasks
nils-werner opened this issue Jan 13, 2020 · 6 comments
Closed
2 of 5 tasks

IPykernel in Poetry not recognised #1859

nils-werner opened this issue Jan 13, 2020 · 6 comments
Labels

Comments

@nils-werner
Copy link

Prerequisites

Description

For some reason Hydrogen does not pick up Jupyter kernels in a virtualenv that was created using Poetry.

Steps to Reproduce

Create a pyproject.toml file

[tool.poetry]
name = "testbla"
version = "0.1.0"
description = ""
authors = ["Nobody <[email protected]>"]

[tool.poetry.dependencies]
python = "^3.7"
jupyter = "^1.0.0"

[tool.poetry.dev-dependencies]

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"

install it

poetry install

And run Atom

poetry run atom .

or

poetry shell
atom .

Run a Python cell. A No Kernels installed message appears.

For comparison, virtualenv works:

virtualenv test; cd test
pip install jupyter
atom . 

Versions

OS version:

macOS 10.15.2 Catalina using Homebrew's Python

atom --version

Atom    : 1.42.0
Electron: 4.2.7
Chrome  : 69.0.3497.128
Node    : 10.11.0

apm --version

apm  2.4.3
npm  6.2.0
node 10.2.1 x64
atom 1.42.0
python 3.7.6
git 2.24.1

Hydrogen version: 2.13.1

Plugins

Have you installed and activated any of the Hydrogen plugins below ?

  • hydrogen-python
  • Hydrogen Launcher
  • Data Explorer

Logs

There is no log output in the Dev Console.

Expected behavior

Hydrogen should recognise Jupyter kernels in both plain virtualenvs and Poetry virtualenvs.

@nils-werner nils-werner added the bug 🐛 For unexpected issues label Jan 13, 2020
@wadethestealth
Copy link
Member

Seems like even though you are in the activated environment it is not able to find where the kernel was installed. I can look into this soon and see whats going on thank you for the detailed report steps 😄

@nils-werner
Copy link
Author

nils-werner commented Jan 14, 2020

Yes, and the weird thing is that

jupyter
jupyter notebook
jupyter kernelspec list

et al worked just fine in both virtualenvs... (run poetry shell first or prepend each line with poetry run to run them in Poetry)

@guyujun

This comment has been minimized.

@wadethestealth
Copy link
Member

@guyujun #1865 is a duplicate. Read the original issue for explanation on current hydrogen installation (v2.13.1 is broken right now).

@guyujun
Copy link

guyujun commented Jan 29, 2020 via email

@nils-werner
Copy link
Author

I found out that the issue was because I was using Poetry from Homebrew.

That version of Poetry does something messy with PYTHONPATH that creates half-complete virtualenvs and apparently also breaks Hydrogen.

Installing Poetry as recommended fixes this problem.

@wadethestealth wadethestealth removed the bug 🐛 For unexpected issues label Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants