jupyter notebook not showing python option under new - python

I am having a problem with creating a new ipython notebook.
Previously I used to do that going to new -> python
but now I am unable to see any python option.
Also, I am unable to open any ipython notebooks, I have one uploading for hours now.
I recently erased my %temp% folder to free some space in the C drive. Does that have something to do with this? How do I fix this?

I solved the problem!
For some reason, jupyter labs was not installed
So running the command
jupyter -- version
and then checking what all was installed, I found out that jupyter labs was not installed?
pip3 install jupyter labs
so I went ahead and installed it and everything works as it did before.
Still don't know the reason why this all happened in particular. If anyone could help me with that'd be awesome!

I'm not sure 100% but this is most commonly related to an ipython jupyter notebook file error. I do recommend to do a clean install of the notebook and try again. As I don't have any specifications on your system is difficult to guide you on the process. But that is the best option you have now.
Also this could have happened because of an update on python, jupyter, your system or any base component required by jupyter or python.

Related

Jupyter notebook renders text instead of ipywidgets

My Jupyter notebook is displaying text rather than ipywidgets. Here is a screenshot:
I read several posts about similar problems, like this one:
Jupyter Notebook not rendering ipywidgets.
Most of them indicate that the solution is to enable an extension, e.g: https://stackoverflow.com/a/38001920/11692496
But it seems to apply to older version of jupyter notebooks. I tried it anyway (with the --sys-prefix argument, which is required for virtualenv), but it didn't fix it.
I'm working with a jupyter notebook and a virtualenv. Just to be sure, I created a fresh venv and installed the minimal packages. No luck.
I'm using Python 3.10.6 and here is my versions list:
Thanks for your help!
For the record, I didn't manage to solve this issue on my virtualenv.
As #Wayne suggested above, I went for a workaround, namely a docker container based on jupyter/tensorflow-notebook

Using Matlab.engine and installing tensorflow at the same time

Currently I am working on a project with Jupyter Notebook in which I need to run a matlab script (.m) which includes a function that provides me with data which i try to solve with a tensorflow model afterwards. I can set up an environment that runs the matlab code an gives me the data and I can set up an environment that does the tensorflow thing but my problem is I can`t do it in the same environment.
Here is the setup and the problems. I am using matlab.engine which I installed like described here: https://de.mathworks.com/help/matlab/matlab_external/install-the-matlab-engine-for-python.html
To run my Jupyter Notebook I first navigate to the location where my python.exe and the matlab files are lying ("C:\Users\Philipp\AppData\Local\Programs\Python\Python37-32\Scripts"). If I try to run pip install tensorflow (in Anaconda Prompt) I got a lot of different errors like the following. Conda install works but even when it is installed i can`t import it.
ImportError: No module named 'tensorflow.core' or
ERROR: Could not find a version that satisfies the requirement tensorflow or just No module named 'tensorflow'
I searched for all those problems but nothing helped me. I think this has something to do with the directory I am working in and I know it is bad but I have no idea how to change that. The error also occurs in different environments.
Have you tried running !pip install tensorflow directly in Jupyter Notebook? It's a temporary workaround, but I am having the same problems and this one helped. Remember to comment it out after installation, so you wont re-run it by accident.
I found a solution to my problem. For this I needed a Jupyter Notebook and an external .py script that I design as a Flask. I can luckily run those in different environments. I past and request the data from the server by using "get" and "post".
If someone still has another idea to do all this in one JN, I would still be happy about answers.

vscode jupyter notebook: Session cannot genreate requests

I've been using vscode with Jupyter notebook extension (now maintain by Microsoft) for two years but It's weird to encouter the problem never met before as the error said:
Error: Session cannot generate requests
at S.executeCodeCell (c:\Users\alex0\.vscode\extensions\ms-toolsai.jupyter-2021.10.1101450599\out\client\extension.js:66:301742)
at S.execute (c:\Users\alex0\.vscode\extensions\ms-toolsai.jupyter-2021.10.1101450599\out\client\extension.js:66:300732)
at S.start (c:\Users\alex0\.vscode\extensions\ms-toolsai.jupyter-2021.10.1101450599\out\client\extension.js:66:296408)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at t.CellExecutionQueue.executeQueuedCells (c:\Users\alex0\.vscode\extensions\ms-toolsai.jupyter-2021.10.1101450599\out\client\extension.js:66:312326)
at t.CellExecutionQueue.start (c:\Users\alex0\.vscode\extensions\ms-toolsai.jupyter-2021.10.1101450599\out\client\extension.js:66:311862)
The problem shows when I train the CNN model. The model I've built previously bumped into this problem, but it works fine when preparing other deep learning models. What I've tried:
Install anaconda, use its kernel.
re-install Jupyter notebook extension and re-open vscode.
run vscode as administrator.
All of them get no luck. The script has been tested and run sucessfully on Google Colab, and it's the alternative I am using now. Is there any way I can fix it?
Other information:
windows 11
vscode version: 1.62.3
jupyter notebook extention: v2021.10.1101450599
anaconda with its Python 3.9.6 version package
Python(self-installed): 3.9.7
I'll provide extra information if necessary. Thanks.
It's likely your kernel is crashing for some reason. Can you log an issue here?
https://github.com/microsoft/vscode-jupyter/issues.

VSCode Jupyter Notebook syntax highlighting and autocompletion stopped working

So, I've been using VSCode for Jupyter notebooks for almost a year and a half now, and it always used to work normally, but a couple of days ago it just got broken, and I don't know why. Here's what I mean:
Jupyter Notebook on VSCode
As you can see, there's no syntax highlighting, and autocompletion doesn't work at all... but if I run the code, it does run perfectly.
It works normally in Python scripts though:
Normal Python Script
Relevant Extensions I've got:
Jupyter (+ Keymap & Notebook Renderers)
Python
Pylance
I've got a bunch of others for C++ and Java.
Also, I've noticed that both Jupyter and Python extensions give an uncaught error, here's what I mean:
Jupyter Extension Error
Python Extension Error
I have no clue what any of this means. I've tried uninstalling and re-installing the extensions, re-installing VSCode, resetting settings.json and restarting my laptop, nothing worked.
Any help will be highly appreciated. Thanks
Do you have installed the extension of Dependency Analytics? You need to disable it.
Some people have run across the same problem, you can refer to here.

jupyter notebook on AWS

I have set up a Jupyter notebook on an AWS box, or so I thought. When I try jupyter notebook, however, I get this:
[C 16:22:30.841 NotebookApp] The 'kernel_spec_manager_class' trait of instance must be a type, but 'environment_kernels.EnvironmentKernelSpecManager' could not be imported
Any suggestions on how to fix?
EDIT actually, when I run jupyter notebook in the base environment, it works (I can't connect to it, but that's obviously a separate problem). However, in a "nonstandard" environment, it does not start. To answer the questions, this is an ubuntu 18.04 deep learning image, and in the environment I had installed jupyter and jupyterlab (via anaconda)
The issue seems to be same as the one described here:
environment_kernels.EnvironmentKernelSpecManager could not be imported
Since in your question you have not indicated that you've tried that, I think that the solution proposed in the link could be tried:
pip install environment_kernels

Categories

Resources