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

Custom kernel venv - cannot find notebook/server #248

Open
jggatter opened this issue Dec 13, 2022 · 1 comment
Open

Custom kernel venv - cannot find notebook/server #248

jggatter opened this issue Dec 13, 2022 · 1 comment

Comments

@jggatter
Copy link

Hi,

I'm looking to report a potential bug I encountered when using a custom ipython kernel that uses a venv python3.10.8 installation.

Problem

A month ago I installed nbproject to use header() in a notebook (https://github.com/laminlabs/lndb-benchmarks/pull/16). Within the Jupyter NotebookApp, I was unable to get header to print, instead receiving the following error:

🔶 It looks like you are running jupyter lab but don't have jupyter-server module installed.Please install it via pip install jupyter-server
🔶 Can not find any servers running.
ℹ️ Can't infer the name of the current notebook, you are probably not inside a Jupyter notebook. Please call `header(filepath='your-file.ipynb')`.

The kernel I was using was a custom one I installed that sources from my venv Python installation, not a conda env. I have reproduced the error on both macOS and Fedora.

Now a month later, I have reproduced it in VSCode on Fedora:
vscode-nbproject
Note the error message here (and now when rerunning in the original notebook) is a bit different:

🔶 Can not find the notebook in any server session.
ℹ️ Can't infer the name of the current notebook, you are probably not inside a Jupyter notebook. Please call `header(filepath='your-file.ipynb')`.

I am not sure if the problem is due to me using a custom kernel or venv.

Steps to reproduce

# Install python 3.10.8

python3 -m venv venv-lamindb
source venv-lamindb/bin/activate

git clone https://github.com/laminlabs/lamindb
cd lamindb/
python3 -m pip install -e .

git clone https://github.com/laminlabs/lndb-benchmarks.git
git checkout primary-keys
git pull

python3 -m pip install jupyter
ipython-kernel install --name "lamindb" --user
jupyter notebook  # Or use VSCode JupyterNotebook extension

Then:

  1. Create new notebook
  2. "Kernel" -> "Change kernel" -> "lamindb"
  3. Restart kernel
  4. Confirm python is sourced from venv: !which python
  5. from nbproject import header; header()
    Uninstall kernel using jupyter kernelspec uninstall lamindb

A solution is not priority for me as there is of course the workaround of using the filepath kwarg. Of course for easy reproducibility on other machines, a solution without filepath would be greatly appreciated. Please let me know if I can provide any further information!

Thank you,
James

@Koncopd
Copy link
Member

Koncopd commented Dec 13, 2022

Thank you for reporting the problem, i will check.

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

2 participants