-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Unable to attach nvim to server on Windows #32
Comments
First of all, the commands will be initialised when you attach to the server, so that's normal. I see that you're using Windows. Let me try on Windows and I'll get back to you soon. |
What is your |
im launching nvim in powershell yes, but when I run I also use neovide...that says |
That is not strange. Unless you explicitly set it to powershell it will be cmd by default. It matters only when you execute shell commands inside vim. I think many plugins assume cmd, so you may as well leave the setting as is. I'm still going to make this plugin compatible with powershell anyway though. Can you test with branch |
On my end the branch works, but I still have one last problem. I can't close neovim when I attach it to the server once. |
2 problems at this stage:
|
For If you started by yourself, it will just open If it started the notebook, it should launch in your file's directory EDIT: If it asked you for a password it means the notebook server is started from somewhere else. If you close the notebook server and try again, it won't ask you for a password and it will be in your file's directory |
For Do you use Conda by any change? In that case I recommend setting the option |
I'll take a look at this in the morning, and maybe reinstall anaconda. Every time I run fyi this is using the base anaconda env, not in a separate env, if that makes a difference |
I also use the base environment (so I can switch environments within notebook) I noticed that the Notebook doesn't close automatically on Windows. I fixed this now btw, but You can use ps jupyter-notebook
Stop-Process <id> to kill the running Notebook process. Once you do it and update the plugin (still use branch |
I'm adding more commits to fix the issue, so when you test it again make sure you update the branch |
Please set this and try again. I added support to be more consistent over platforms. require("jupynium").setup({
python_host = { "conda", "run", "--no-capture-output", "-n", "base", "python" },
jupyter_command = { "conda", "run", "--no-capture-output", "-n", "base", "jupyter" },
}) |
I did a completely fresh install of anaconda, and even wiped my nvim-data directory just for a fresh start. Using the latest on your windows branch and the new config you provided, I still run into the same problem as before. Here is my entire nvim config: https://github.com/sho-87/dotfiles/blob/jupynium/nvim/lua/plugins/modules/jupynium.lua I'll try to be specific about my steps... Problem 1 - trying to get basic syncing working
Problem 2 - trying to get basic syncing working
Problem 3 - trying to load an existing notebook
The reason I tried (3) was because I remember I had syncing working at some point before the anaconda uninstall. I could scroll in nvim and I would see the change in firefox. I could even add cells and clear output; the problem was the dead kernel prevented me from running anything So I guess my 2 overarching problems are 1) I don't know how to correctly "open" a notebook that already exists, and 2) how to get the kernel to run/restart so code can execute Jupyter seems fine by itself. I can |
Is it |
I cannot reproduce the problem 2 and 3. I tried to also uninstall miniconda and install it again. The kernel and the command both works fine for me.. Maybe the dead kernel stuff is causing both problems Can you try running |
Btw, this is my entire require("jupynium").setup({
python_host = { "conda", "run", "--no-capture-output", "-n", "base", "python" },
jupyter_command = { "conda", "run", "--no-capture-output", "-n", "base", "jupyter" },
}) And I just cloned this plugin at Maybe consider testing like this in a fresh environment. I doubt that the kernel error is related to the neovim configuration though. I think it's more related to how you installed jupyter notebook. For me, after fresh installing miniconda3 I ran conda activate
conda install python=3.10
pip install notebook
cd "C:\Users\Kiyoon Kim\AppData\Local\nvim-data\site\pack\dev\start\jupynium.nvim"
pip install -e . |
You said running |
(all of the above was with the latest commits you pushed) One big difference here is that youre using miniconda, whereas im using the full anaconda stack: https://www.anaconda.com/products/distribution Does anaconda install jupyter in some special way beyond simply a pip install? |
Thank you. If you run notebook and then use Jupynium, do you still have the problem 3? |
what would be the correct commands in Jupynium if im starting the notebook myself first? |
Same command. It will just not launch the notebook if you already have |
I've never used anaconda but in my understanding they should be similar. I installed notebook with command Hypothesis 1: Are you using Notebook 6.5? Maybe different version doesn't support some parameters. Can you try running with this? This is the full command Jupynium should use to launch the server conda run --no-capture-output -n base jupyter notebook --port 8888 --no-browser --NotebookApp.token abcdef --NotebookApp.notebook_dir C:\Users\username Hypothesis 2: Maybe jupynium is just running the wrong command. Check 1. Did you uninstall the previous conda environment completely? |
Running
looks like anaconda comes with notebook 6.4. will try an update to 6.5 soon
|
Okay, because of the last part, it sounds to me that you have two different conda installed. You didn't install jupynium in the new conda environment.
Check 3. Run |
Or go to |
You can also try setting the neovim's shell to powershell.exe and that may use the correct conda you're using as well. |
About the freezing part I'll need to investigate later. |
|
Maybe that's not the case then..
|
ok i think this is a miniconda vs anaconda difference. I just completely uninstalled anaconda and installed a fresh miniconda, and went through these steps:
In nvim, I'm not sure what the differences are in terms of how miniconda and anaconda install packages (pip vs conda, or something else), but off the bat there are differences in python (3.9 vs 3.10) and package versions (notebook 6.4 vs 6.5) |
I see. Thanks for testing that setup and glad that it works! If you're happy I'll merge the PR later today. In my experience sometimes the conda environment breaks. For example I noticed recently that the conda install doesn't install pytorch with GPU, even though I used the same command as before. Maybe they have some consistency and stability issues. Also the hanging issue seems to be caused from invoking javascript to grab the content from the notebook. Not sure when it happens maybe I can add a timeout to the command so you wait only up to 10 seconds. If you find this keep happening feel free to open another issue. |
unfortunately I cant actually use miniconda permanently, as the stack at work uses the full anaconda setup - so ill have to try to see what the differences between the 2 actually are and figure out a solution |
Fair enough. Maybe if you try matching the version it may work. The worst case you'll have to open the Notebook server by yourself but I think that's managable. |
This got automatically closed by merging, but feel free to continue the discussion. |
I'm following the usage instructions and when I run
:JupyniumStartAndAttachToServer
in nvim, a window opens for a few seconds and closes - no browser or notebook appearspip freeze
shows that both jupynium and selenium packages are installed:Testing selenium from python also works OK:
When I simply run
jupynium
from the terminal, firefox opens showing the notebook tree and the following info:At this point, I go back to nvim and run
:JupyniumAttachToServer
but I get the following exception:Not sure if this is related, but nvim doesn't seem to have access to any of the sync commands like
JupyniumStartSync
. it only sees these:The text was updated successfully, but these errors were encountered: