My Jupyter Notebook doesn't work properly - python

It worked well yesterday on Windows.
But in the morning today when I ran Jupyter in my environment and Chrome showed up, it didn't show anything but white.
Like this:
Webpage and Cmd.
I turned off the firewall, checked my hosts and runned
pip install --upgrade jupyterhub
But nothing happend.
I'm new so I don't know how to deal with it. I'll appreciate it if someone could help me out.
I find that I can run my jupyter if I click the shortcut "Jupyter Notebook" but I can't run it in my environment. Why?

I solved this problem. Here is the link
https://github.com/jupyter/notebook/issues/4467
The reason is that I'm using a newer version of Jupyter installed by command
conda install jupyter
which causes the trouble.

Related

Why aren't conda commands working in Spyder?

I recently downloaded Spyder using Python 3.9.12. For some reason, every time I try to use a conda command (such as conda activate env), the Spyder terminal gives the message 'Note: you may need to restart the kernel to use updated packages.' I've restarted the kernel multiple times, but the same message persists, essentially meaning that I cannot use conda commands in Spyder. However, they work fine in the regular Anaconda3 prompt. Does anyone know how to fix this? Thanks in advance!

Why does Jupyter Notebook stop working after a few seconds?

I have a problem with Jupyter and can't find anything by someone with the same experience. When I start Jupyter Notebook, it only lasts for a few seconds until it freezes. Sometimes it happens in the command prompt before my browser is opened, most of the times when I'm navigating through my directories and sometimes, if it really wants to rub it in, when I've finally opened a notebook.
I've tried reinstalling both Jupyter and Anaconda, but that didn't help. I've also tried different versions Jupyter and Python. This is what I do:
conda env create -n myname python=3.6 pip
activate myname
conda install jupyter OR pip install jupyter
jupyter notebook
I also tried installing from the Anaconda dashboard. Sometimes it works for a day and then a little later, I get the same problem again. The console also stops outputting data.
It doesn't seem to happen in the base environment.
Does anyone know how to fix it?

Pandas and Jupyter not found after upgrading to Catalina

I just updated my macOS to Catalina and I can't run python or open a jupyter notebook from terminal anymore. As an example, I get error message "ImportError: No module named pandas" when running my python code, and I get
zsh: command not found: jupyter
when running
jupyter notebook
This issue has brought me to anaconda (I would love someone to explain me why. Does python need anaconda to be ran?). I have tried several suggestions from https://github.com/ContinuumIO/anaconda-issues/issues/10998, e.g. I have tried copying folder "anaconda3" from "Relocated items" folder to "Users//", then
export PATH=''/Users/<username>/anaconda3/bin:$PATH"
but I get either
dquote>
or
zsh: /Users//Applications/anaconda3/bin/conda: bad interpreter: /anaconda3/bin/python: no such file or directory
I then tried to reinstall Anaconda using the graphic installer (from https://www.anaconda.com/distribution/#macos) following advice from someone from the anaconda team (https://www.anaconda.com/how-to-restore-anaconda-after-macos-catalina-update/) (I changed installation location to a folder I created in /Users//) but I still get the same error messages when running python3 or jupyter notebook.
How can successfully run python and jupyter notebook with macOS Catalina?
After installed macOS Catalina, we can switch the terminal from bash to zsh. There are many advantages from using zsh instead of bash, but One of the issues with zsh is some of the frameworks (jupyter notebook,conda) are not supported directly. Once I typed jupyter notebook in terminal to run it. It displayed “zsh: no such file or directory”.
The solver is simple but very difficult to find online.
If jupyter was already installed before the update and stopped working after zsh, you should be able to fix it by:
1.open zshrc in terminal by typing: open .zshrc or $open .zschrc
2. add the following line at the end of the file:
source ~/.bash_profile
It will ask zsh to use all the information from bash like the path of jupyter.
Hope it can help you out!
I'm answering to my own question in case it can help others ;)
I found my answer here: https://medium.com/#singhaniatanay18/mac-os-catalina-update-zsh-instead-of-bash-d688f68f70b8
(see comments as well)
Mac OS BigSur:
Uninstall Anaconda:rm -f Anaconda-Navigator.app
re-install pip3 install jupyterlab
I just updated to Catalina, two days before Big Sur release.. oh well.
Catalina came with changes to security and bash, that will remain for future releases. So Catalina moves your anaconda3 folder to /Users/Shared/Previously Relocated Items/Security/anaconda3 I tried to move it back to home directory, but that didn't work. So I deleted it, and reinstalled Anaconda using the command line installer Not the GUI installer, and it worked for me. You can follow instructions here and use /Users/me/anaconda3 folder as recommended here.
Here are the commands that worked for me,
shasum -a 256 /Users/username/anaconda3 . Although not sure it did anything
bash ~/Downloads/Anaconda3-2020.02-MacOSX-x86_64.sh or whatever the name of the command line installer from Conda in your Download folder, or wherever else you downloaded it.
Use sudo in front of the command if permission was denied, then enter your log in password for your Mac
source /Users/username/anaconda3/bin/activate conda init zsh
sudo conda init zsh then enter your Mac's password.
You should be all set now, and all commands like ipython, conda info, jupyter notebook, pyspark will all work.
The last command will make step3 command persist i.e. initialize conda base environment, such that you can run conda, ipython, jupyter notebook the next time you use terminal.
Install the Jupyter using Homebrew in zsh shell
If you don't Python install 3.3or higher.
Open terminal
Using Homewbrew install jupyter
brew install jupyter
Now, you start a notebook
jupyter notebook

Windows 10 not opening jupyter notebook in Command Prompt

I tried to open the jupyter notebook using Command Prompt on Windows 10. Instead of it opening in the browser as it should, nothing happens.
I have downloaded jupyter using
pip install jupyter
pip install jupyter notebook
All this worked fine but when I type this in Command Prompt only a new line forms and nothing happens.
C:\Users\meena\OneDrive\Desktop\New folder>jupyter notebook
C:\Users\meena\OneDrive\Desktop\New folder>
I have tried to install jupyter many times but it doesn't work.
I only have python and not anaconda. So if someone else has the same problem and has tried anaconda please tell me so I can download it.
Have you tried typing jupyter-notebook and see if it works? I upgraded Anaconda recently, and typing jupyter notebook stopped working for some of my files, but I solved the problem by typing jupyter-notebook.

Unable to start Spyder after conda update/install packages?

I was playing around with Spyder today, and ran ONLY the following in the cmd window:
conda update scikit-learn
conda install matlibplot --force
Both ran successfully, to completion. Now, all of a sudden, Spyder doesn't start after updating one package and installing one package. I rebooted my machine; sitll can't gte Spyder to run. Is there some kind of master reset, or some trick to manually get Spyder to statup? Thanks to all.
When I reun 'spyder --reset', I think it's supposed to reset everything. That's what I'm seeing from various posts. When I enter that into the Anaconda prompt, all I get is 'Python has stopped working. Windows is checking for a solution'. Then I have to close the error prompt, and that's then end of it. There should be an easy way to fix something like this. Literally, all I did was upgrade 2 packages. There's no way Python can be this unstable, or fragile.

Categories

Resources