vscode Jupyter notebook run button missing - python

Everything works fine when I first open vscode and create a new Jupyter notebook
When I save and reopen it, the run button is gone.
I have added "jupyter.experiments.optOutFrom": ["NativeNotebookEditor"] to setting.JSON and still no change
python is installed
Jupyter notebook installed
How can I make it to work?

It looks weird, the appearance of the jupyter notebook in your question is different from mine:
In my memory, it looks like the older version of the jupyter notebook.
Could you provide more info about the jupyter notebook you are using? Like this:
And could you try to reinstall the Jupyter Notebook extension and disable other extensions which may be related to .ipynb file?

Use shift+enter and that should run the cell.

You should open the folder as a workspace and then, the button is shown. If you only open the file the result is that you can read the content, but not run the python code.

To elaborate on Steven-MSFT's answer, I saw that there was a button called "Reload Extension" indicated on this drawing below:
You can access this sidebar by entering cmd + shift + p, and then entering "Extensions: Install Extensions", as seen below:
Once I reloaded my Jupyter extension, all worked fine for me.

I had the same problem today. Uninstall and reinstall of "Jupyter" extension solved it.

Related

VSC Updated and Broke Jupyter Notebook

I think two weeks ago, or right at the end of Feburary, VSC updated as normal. Except, in my experience, it broke the Jupyter Notebook extension, kind of. I can still open notebooks and play with them, they still connect to the kernel and run, but I can't save any new notebooks. Which is frustrating because I need to make new notebooks for my classes.
First, I'll say that I have tried to update and reinstall jupyter. By that, I mean:
pip install --upgrade notebook
pip install --upgrade jupyterlab
pip install --upgrade jupyter
Then I uninstalled VSC, and reinstalled to see if that would fix it, but the problem remains.
Here are detailed pictures of what my issue is.
I open a new file, and go to select language
Inside the languages, jupyter isn't even there
Instead I go down to open the command palette because thats where you have to open new jupyter notebooks anyway
Here you can see it says create new notebook
It does, it works as its supposed to
Then I go to save the notebook and this is totally new. It's saving it as JSON, but has the ipynb extension. Additionally, the directory I'm saving into has other notebooks in it. They don't show up with this new .ipynb.json.
It doesn't matter if I erase, leave, force the extension to be .ipynb, .json, .ipynb.json, or if I just erase it, I get this same error, and I'm not sure why.
I can't seems to get over this problem, and I'm not sure how to fix it. Let alone, what's caused this issue. Maybe somebody has had this before and worked around it, or currently has this problem?
I can not reproduce your problem, Could you try to disable all the extensions and then only enable Python-related extensions? If it still does not work, could you try to install an older version of VSCode? You can refer to here.
Change "save as type" to "All files (.)" if *.ipynb isn't a choice outright to make sure you get *.ipynb as the extension, not *.ipynb.json.

Jupyter in VSCode

enter image description here
At first, jupyter notebook works fine. BUT, whenever I try to use the other ipynb file, jupyter notebook does not work and send this message. How should I deal with this?
Have you checked which python interpreter you are using in the Jupyter Notebook?
With the different names of the .ipynb file, it will take the different kernels, and it is stored in the database.
First of all, create a virtualenv. Open the terminal using Ctrl+Shift+`.
In the console, type python3 -m venv venv.
This will create a folder named venv in your working directory.
Now, in the bottom left corner, you will find the selected python interpreter. Click that and change it to venv.
(If windows raises permission error, In your vsCode settings, add the following lines.)
"terminal.integrated.shellArgs.windows": ["-ExecutionPolicy", "Bypass"]
Now delete all previous terminals and open a new terminal.
Install the required packages using pip and carry on.

VS Code can't open ipynb file

Have everyone already had this problem, where VS Code keeps loading all the time and won't open a ipynb file? I've tried to use python 3.7 but same problem. Also tried to reinstall both VS Code and Anaconda, no success.
Here is my environment data:
VS Code version: 1.49.0
Python extension version:v2020.8.108011
OS and version: Ubuntu 20.04
Python version (& distribution if applicable, e.g. Anaconda): Anaconda python 3.8.3
Type of virtual environment used: using conda base environment
Value of the python.languageServer setting: "Pylance"
ipython version: 7.16.1
jedi version: 0.17.1
ipykernel version: 5.3.2
I've solved (for now) this problem by downgrading jupyter extension to previous version.
Go to Extension (in the left vertical panel) > select Jupyter > click the down arrow of the Uninstall button > then you get "install another version" tooltip > click it > select other version > reload vscode
In their official GitHub page, they are tracking this issue already. There is also a solution (kind of) right now. You have to maximize the terminal panel below and then restore the panel size (basically max and min with the arrow button). Then the Notebook loads and everything works fine. :D
The workaround was in this comment: https://github.com/microsoft/vscode-python/issues/13901#issuecomment-691625412
Not perfect but at least all the features are there and I can work with my notebooks again :)
I'm facing the same issue after the latest update. You can try importing the notebook by pressing ctrl+shift+p/command+shift+p and run Import Jupyter Notebook.
For me maximizing and resetting the terminal panel didn't work whereas uninstalling and reinstalling the VSCode Python extension solved the problem.
I'm facing the same problem since the last update.
For now, in case you still want to use VSCode, you can 'convert to python script' and run it in interactive mode (right click on the notebook, and choose that).
It doesn't solve the issue, but make it possible currently to use your notebooks in VSCode.
I have the same behavior. Downgrades of Jupyter extension works for me
(screen)
In VS Code, double-clicking just stopped working for me for some reason.
Try right-clicking the *.ipynb file in the VS explorer panel and select 'Open in Notebook Editor'
Download the jupyter Notebook extention in VS code.
and than click the .ipynb file.
After clicking .ipynb file vs code will preview.
enter image description here

Jupyter - Not sure if not working or broken link

I am trying to open a notebook with jupyter, by using the following command:
jupyter notebook notebook.ipynb
I use Linux and python2, I have installed jupyter inside a virtualenvironment with pip.
When I run the command above, what happens is that I get a new screen
REFRESH(1 sec): http://localhost:8889/notebooks/mylink
This page should redirect you to Jupyter Notebook. If it doesn't, click here to go to Jupyter.
However, there is no dashboard opening automatically. So, I clicked on the link, but I am unable to connect. The weird think is that I don't remember what I did yesterday, but I managed to get through very easily.
Am I doing something wrong? Or maybe there is a problem with the link?
EDIT: If I run
jupyter notebook.ipynb
I get
Error executing Jupyter command 'notebook.ipynb': [Errno 2] No such file or directory
which does not make sense, because the file notebook.ipynb is actually there.
If I type
jupyter notebook stop
I get
There are no running servers
Happened to me too. Also their troubleshooting could not resolve the issue. You may note the This Worked An Hour Ago section.
If you are using environments, try creating a new environment and install jupyter notebook from scratch there. For Anaconda it would look like this:
conda create --name jupyter_env
conda activate jupyter_env
conda install -c conda-forge jupyterlab
jupyter notebook
You may change jupyter_env to a differen name of your liking.
What I usually do is run
jupyter notebook
and it will automatically open up the browser with my current directory. I then search for my notebook that way.
I guess one of these could help you fix this one:
change url to http://127.0.0.1:8889/notebooks/mylink or http://0.0.0.0:8889/notebooks/mylink
in case proxy or any other network settings set on your browser, disable them and check twice
if none of them did work, try to enter the url this way: http://localhost:8888/tree?
And, provide logs from console might help as well.
And one more thing, just to make sure, why you're connecting via port 8889? did you tried to run jupyter by --port command option?

Error While Launching jupyter Notebook

I am using Python 3.4 version and when I am trying to open the jupyter Notebook the explorer does open but it displays a link in the explorer like this and after that nothing happens.I am not able to view anything in the explorer
http://localhost:8823/tree?token=27c7f7543497392b736e1f2b74f1d6af93c2065dcbe67c61
What should I do to see the proper jupyter notebook? thanks in advance
You can just retype the url to
http://localhost:8823
If it still show nothing, try to run it on another non empty directory
jupyter notebook --notebook-dir="C:\another directory"
I typed jupyter notebook list on the annaconda prompt , it then gave me a list of all the currently running servers.
i copied one of the servers in the chrome window and it worked

Categories

Resources