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

Cannot connect to neopyter extension #15

Open
vanducng opened this issue Oct 6, 2024 · 2 comments
Open

Cannot connect to neopyter extension #15

vanducng opened this issue Oct 6, 2024 · 2 comments

Comments

@vanducng
Copy link

vanducng commented Oct 6, 2024

hi @me,
Im trying to create both test.ju.py in nvim an test.ipynb on jupyter lab. The neopyter is configured as instruction. However, when checkhealth for neopyter, it shows as below. Perhap I did something wrong, can you pls advise?

==============================================================================
neopyter: require("neopyter.health").check()

neopyter: config ~
- {
    auto_attach = true,
    auto_connect = true,
    file_pattern = { "*.ju.*" },
    filename_mapper = <function 1>,
    highlight = {
      enable = true,
      shortsighted = false
    },
    jupyter = {
      auto_activate_file = true,
      scroll = {
        align = "auto",
        enable = true
      }
    },
    mode = "direct",
    on_attach = <function 2>,
    parser = {
      line_magic = true,
      trim_whitespace = true
    },
    remote_address = "127.0.0.1:9001",
    textobject = {
      enable = true
    },
    use_default_keybindings = false
  }

neopyter: version ~
- neovim plugin(neopyter@0.2.6) status: inactive

CleanShot 2024-10-06 at 23 40 36@2x

@AbaoFromCUG
Copy link
Collaborator

Looks weird, Whenever you open a xxx.ju.py (e.g. :e main.ju.py), the neovim plugin(neopyter) should be activated, it should look like:

neopyter: version ~
- neovim plugin(neopyter@0.2.6) status: active
- jupyter lab extension: don't connect

neopyter: status ~
- attach=ready, connect=syncing
  
-   file                           attach     connect    remote_path
- * main.ju.py                     true       false

and here is my all :checkhealth neopyter result


==============================================================================
neopyter: require("neopyter.health").check()

neopyter: config ~
- {
    auto_attach = true,
    auto_connect = true,
    file_pattern = { "*.ju.*" },
    filename_mapper = <function 1>,
    highlight = {
      enable = true,
      shortsighted = false
    },
    jupyter = {
      auto_activate_file = true,
      scroll = {
        align = "auto",
        enable = true
      }
    },
    mode = "direct",
    on_attach = <function 2>,
    parser = {
      line_magic = true,
      trim_whitespace = true
    },
    remote_address = "127.0.0.1:9001",
    textobject = {
      enable = true
    },
    use_default_keybindings = true
  }

neopyter: version ~
- neovim plugin(neopyter@0.2.6) status: active
- jupyter lab extension: don't connect

neopyter: status ~
- attach=ready, connect=syncing
  
-   file                           attach     connect    remote_path
- * main.ju.py                     true       false

In the current state, neovim should listen to the network port 9001

lsof -i:9001
COMMAND   PID USER FD   TYPE DEVICE SIZE/OFF NODE NAME
nvim    21975 abao 31u  IPv4  66442      0t0  TCP localhost:etlservicemgr (LISTEN)

Some tips may help you

  • Don't open two neovim program instance with same address be listened
  • Neopyter(neovim plugin) is activated by an autocmd of BufReadPost with file_pattern automatically

@vanducng
Copy link
Author

Thanks @AbaoFromCUG,
I think there was an issue with the socket connection. I got it fixed by following this discussion: zauberzeug/nicegui#1178 (comment)

CleanShot 2024-10-11 at 13 02 23@2x

I now can see it listened to port 9001 but status is still inactive. I will try to debug more.

CleanShot 2024-10-11 at 13 25 46

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