Skip to content

Cannot connect to neopyter extension #15

Closed

Description

@vanducng

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

Activity

  1. AbaoFromCUG commented on Oct 11, 2024

    @AbaoFromCUG
    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
  2. vanducng commented on Oct 11, 2024

    @vanducng
    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

  3. eokoshi commented on Jun 22, 2026

    @eokoshi

    what is the solution?

  4. AbaoFromCUG commented on Jun 26, 2026

    @AbaoFromCUG
    Collaborator

    what is the solution?

    As mentioned:

    Looks like editing /etc/hosts to explicitly use the hostname vs. localhost is a workaround. Just not ideal from a DX perspective.

    127.0.0.1       localhost
    127.0.0.1       mbp
    255.255.255.255 broadcasthost
    ::1             localhost
    

    Could you share your :checkhealth neopyter?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions