marimo-team / vscode-marimo

marimo vscode extenion
https://marketplace.visualstudio.com/items?itemName=marimo-team.vscode-marimo
MIT License
33 stars 5 forks source link

marimo convert does not work; new notebook not working #38

Closed guyrosin closed 4 weeks ago

guyrosin commented 2 months ago

Describe the bug

Hi, I tried using marimo via the vscode extension and encountered multiple errors. First, converting a jupyter notebook to marimo didn't work and showed the following error message: Failed to convert notebook: Command failed: marimo convert '....ipynb' /bin/sh: 1: marimo: not found

Second, when I created a new marimo notebook (using the vscode command), the created notebook seemed to be faulty - it was initialized with a "Loading..." cell, and every action I took resulted in a new error message in the marimo log:[🛑 error] [kernel-manager] No key found in notebook metadata. This error was raised on each keystroke.

Environment

{ "marimo": "0.7.17", "OS": "Linux", "OS Version": "6.5.0-1015-aws", "Processor": "x86_64", "Python Version": "3.11.9", "Binaries": { "Browser": "--", "Node": "--" }, "Requirements": { "click": "8.1.7", "importlib-resources": "missing", "jedi": "0.19.1", "markdown": "3.6", "pymdown-extensions": "10.9", "pygments": "2.18.0", "tomlkit": "0.13.0", "uvicorn": "0.30.5", "starlette": "0.38.2", "websockets": "12.0", "typing-extensions": "4.12.2", "ruff": "0.5.6" } }

Code to reproduce

No response

akshayka commented 2 months ago

Thanks for reporting. We've spent the vast majority of our time working on the marimo in-browser editor -- our VSCode extension is very much work-in-progress, but it is supposed to work :) Seems like we regressed something(s). We'll look into it.

akshayka commented 2 months ago

Failed to convert notebook: Command failed: marimo convert '....ipynb' /bin/sh: 1: marimo: not found

This suggests that marimo is not installed. Did you install marimo with a package manager such as pip or conda? The vscode extension doesn't bundle marimo.

guyrosin commented 2 months ago

Yes, marimo is installed and works via the CLI

VivaldoMendes commented 2 months ago

@guyrosin, in my case, I can confirm that I do not need to use the CL interface to run an existing notebook in VSCode. I just click on start marimo + start in marimo editor (edit). If the notebook is large, it takes a while to open, but that is OK. The text file appears on the left pane, and the editable notebook on the right pane. However, I have never created a notebook from scratch using VSCode.

I am on a Windows machine, using Python 3.12.3 and marimo 0.7.17. However, it works as smoothly on Linux as it does on Windows.

guyrosin commented 2 months ago

Opening an existing marimo notebook via vscode doesn't work for me as well: Command 'marimo: Start in marimo editor (edit)' resulted in an error: fetch failed. Also, sometimes it just loads indefinitely with the following log message: [server-manager]: Finding open port...

VivaldoMendes commented 2 months ago

If you have the marimo extension for VSCode installed, I think it should work.

akshayka commented 2 months ago

Failed to convert notebook: Command failed: marimo convert '....ipynb' /bin/sh: 1: marimo: not found

I can reproduce this issue; the extension's convert command isn't picking up my Python interpreter.

Second, when I created a new marimo notebook (using the vscode command), the created notebook seemed to be faulty - it was initialized with a "Loading..." cell, and every action I took resulted in a new error message in the marimo log:[🛑 error] [kernel-manager] No key found in notebook metadata. This error was raised on each keystroke.

This I can't reproduce but I don't doubt that you're experiencing it.

Thanks for your patience, the vscode extension is still experimental.

I'm going to transfer GitHub issue to our vscode extension repo to better track it.

guyrosin commented 2 months ago

Thank you!

VivaldoMendes commented 2 months ago

@guyrosin , do you have some particular Python distribution installed on your computer?

I have VScode and marimo installed on three different machines (Windows 10, Windows 11, and Linux Ubuntu) and a minimalist Python v3 installation (no Anacondas nor other fancy installation). In all three cases, I can edit a marimo notebook by using the buttons that VSCode automatically makes available when I load a notebook: start marimo + start in marimo editor (edit). The integration of marimo in VSCode works so well that when I load a notebook, VSCode even tells me a new marimo version is available (if there is one). On the other hand, all the changes I implement in the marimo preview pane will be immediately visible on the VSCode text pane. This is a beautiful functionality if we need to move cells around.

What may be interesting to you, given your problem, is that I tried to load a marimo notebook on a family member's computer, which has Python v3, through the Anaconda distribution (Windows 11). It does not work because there are well-known problems between VSCode and its recommended extension for Python, on the one hand, and the Anaconda installation of Python 3v on the other. This fact can be easily checked on the internet, and while some solutions have been proposed, the evidence in my place has not been very positive.

I hope this information can help. I do not know any other way to be helpful; in my case, everything works well.

guyrosin commented 2 months ago

Thank you @VivaldoMendes for the tips! But unfortunately even after creating a new venv (with python 3.12 and pip) both marimo commands don't work for me. I'll patiently wait for the devs to fix those :)

cValtulini commented 1 month ago

I encountered the "Loading..." issue too, when selecting "Open as VSCode notebook" from the Applications view.

I can see from the terminal that the server is started (marimo edit etc. command is launched). I can access it from the system browser (haven't tried the embedded one), but then there are no running notebooks.

Somehow, going to the settings in VSC and changing the default marimo port to 2719 solved the issue for me. I now opened the notebook a couple of times (reloading and then also restarting VSC) from the "Open as VSCode Notebook" button and everythings good.

Hope this is helpful.

f-fuchs commented 1 month ago

I encountered the "Loading..." issue too, when selecting "Open as VSCode notebook" from the Applications view.

I can see from the terminal that the server is started (marimo edit etc. command is launched). I can access it from the system browser (haven't tried the embedded one), but then there are no running notebooks.

Somehow, going to the settings in VSC and changing the default marimo port to 2719 solved the issue for me. I now opened the notebook a couple of times (reloading and then also restarting VSC) from the "Open as VSCode Notebook" button and everythings good.

Hope this is helpful.

Hey,

I have a similar problem. I am always stuck on [server-manager]: Finding open port... unless I switch the port. Not sure why but it also always needs to be a new port going back to port 2718 after going up to 2722 did not work...