ipython notebook command in anaconda opens jupyter notebook? - installation

The following is the command and the result.
[Anaconda2] C:\Users\Gurminder>ipython notebook
[TerminalIPythonApp] WARNING | Subcommand `ipython notebook` is deprecated and will be removed in future versions.
[TerminalIPythonApp] WARNING | You likely want to use `jupyter notebook`... continue in 5 sec. Press Ctrl-C to quit now.
[I 17:56:25.760 NotebookApp] Serving notebooks from local directory: C:\Users\Gurminder
[I 17:56:25.763 NotebookApp] 0 active kernels
[I 17:56:25.763 NotebookApp] The IPython Notebook is running at: http://localhost:8888/
[I 17:56:25.766 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
And the display on the browser looks like following:
Why is it launching jupyter when I am giving the command to launch ipython.
I have updated all the packages including ipython.

The answer is on the IPython website:
IPython is a growing project, with increasingly language-agnostic
components. IPython 3.x was the last monolithic release of IPython,
containing the notebook server, qtconsole, etc. As of IPython 4.0, the
language-agnostic parts of the project: the notebook format, message
protocol, qtconsole, notebook web application, etc. have moved to new
projects under the name Jupyter. IPython itself is focused on
interactive Python, part of which is providing a Python kernel for
Jupyter.
In summary, what previously was known as the IPython notebook now is the Jupyter notebook. Apart from the name, they are practically the same.
It even says so in the warning message you get:
[TerminalIPythonApp] WARNING | Subcommand `ipython notebook` is deprecated and will be removed in future versions.
[TerminalIPythonApp] WARNING | You likely want to use `jupyter notebook`... continue in 5 sec. Press Ctrl-C to quit now.
ipython notebook is deprecated and you should use jupyter notebook instead, but IPython plays nice and runs the Jupyter notebook for you.

Related

Jupyter Lab shows last used folder as the root directory when run from terminal (can't go up), but it's ok when run from Anaconda

I've been using Anaconda and Jupyter Lab & Notebook for a couple of months. I have 4 environments and had the usual problems I guess everyone has with package conflicts and such.
Today, when I was running a ipynb file in Jupyter Lab (run from Terminal), it got stuck when iterating over files and unzipping them, so I rebooted my Mac.
When I entered Jupyter Lab again, the folder it showed in the file browser was the last one I had used. It didn't have the option of going up, and if I entered a path in "open from path", it said that it couldn't find it. It's like the last folder I used is now considered the root path.
I tried running Jupyter Lab again from terminal, but same thing.
Of course, other environments weren't affected.
I thought it was a Jupyter Lab configuration problem, but when I run Jupyter Lab from Anaconda, it went back to working perfectly, so I'm wondering if there is a configuration setup specifically for Terminal.
I can work from Anaconda, and I can also reinstall the environment if needed, but I'd prefer to go back working the way I was.
Jupyter Notebook works fine.
Can anyone shed a light on what can be happening?
Thanks!
I tried:
reboot the computer
exit and reenter Jupyter Lab
go to "open from path"
search for jupyter config file with "jupyter --config-dir". Found "default-37a8.jupyterlab-workspace" in the /User/.jupyer/lab/workspaces folder, and it has the initial config for Jupyter Lab (directory, files opened), but it takes the info from when I close the instance I run from Anaconda. When run from terminal it's like it takes the initial config from somewhere else.

Does jupyter lab work within its own conda environment it was installed in?

I have multiple conda environments on my PC created with Anaconda and I have installed jupyterlab in two of them. I used one environment for R programming and the other for Tensorflow with Python. I have noticed that whenever I open jupyter lab in either of the environments, it always starts off where I left it. That is, the last open notebooks are opened on start. Of course, this doesn't bother me too much, but it makes me think each jupyter lab installation isn't contained within its own environment.
For example, I have two environments. Say they're called env_R and env_Python_TF. I have installed jupyter lab in both environments.
I open Anaconda Powershell prompt and launch each environment using the following commands:
(base) PS $ conda activate env_R
(env_R)PS $ jupyter lab
Say I work on jupyter lab and once I'm done, I close the browser windows and then shut down the server using CTRL+C in Anaconda Powershell prompt. Now if I open up my second environment using:
(base) PS $ conda activate env_Python_TF
(env_Python_TF)PS $ jupyter lab
Now I see the same notebooks I used with env_R opened up when jupyter lab opens in my browser.
Aren't each jupyter lab installation contained within its own conda environments? If not, have I possibly made a mistake in my configuration?
it should be within its own conda environment but Default root folder /location will remain same for jupyter notebook. You will need to change it using config file.
Here is link

How to make jupyter start in current directory by default (in cmd.exe)?

In Windows 10 cmd.exe I can start jupyter in a current directory by following command:
jupyter notebook --notebook-dir="."
The current directory is C:\Users\Евгений\Documents\GitHub\sandbox
However, when I start simply jupyter notebook in a current directory above my working directory for jupyter is D:/git:
λ cd
C:\Users\Евгений\Documents\GitHub\sandbox
λ jupyter notebook
[I 14:46:44.273 NotebookApp] The port 8888 is already in use, trying another port.
[I 14:46:44.304 NotebookApp] JupyterLab beta preview extension loaded from D:\Anaconda3\lib\site-packages\jupyterlab
[I 14:46:44.304 NotebookApp] JupyterLab application directory is D:\Anaconda3\share\jupyter\lab
[I 14:46:44.571 NotebookApp] Serving notebooks from local directory: D:/git
Note the last line Serving notebooks from local directory: D:/git. Where is D:/git may be coming from? Are there environment variables other than these affecting working directory choice?
My %USERPROFILE%/.jupyter is totally empty.
jupyter --config-dir directs to C:\Users\Евгений\.jupyter, it is %USERPROFILE%/.jupyter.
I read various threads about jupyter invoke, in particular:
this large thread suggests jupyter notebook will behave differently in cmd.exe and Anaconda prompt, without further details though
Problems with configuring Jupyter start directory addresses an issue with Windows shortcut, similar to this Windows app start steps
this post proposes wrapping --notebook-dir="." key into a .bat file
My other thought is that %USERPROFILE% with non-Latin character is not be recongnisable by jupyter, but %USERPROFILE%/.jupyter is empty anyways.
You must generate the configuration of Jupyter.
jupyter notebook --generate-config
Navigate to your folder and the folder .jupyter (C:\Users\%username%\.jupyter)
You will find a file called jupyter_notebook_config.py
Edit it with notepad++ for exemple and locate c.NotebookApp.notebook_dir
Between ' ' put the path you want. For exemple :
c.NotebookApp.notebook_dir = 'C:/Users/Евгений/Documents/GitHub/sandbox'
Save it and start Jupyter without specifying a path
Be careful, the characters in your username may be a problem.
Keep me informed.
Use the jupyter notebook config file:
Open cmd (or Anaconda Prompt) and run jupyter notebook --generate-config.
This writes a file to C:\Users\username\.jupyter\jupyter_notebook_config.py.
Browse to the file location and open it in an Editor
Search for the following line in the file: #c.NotebookApp.notebook_dir = ''
Replace by c.NotebookApp.notebook_dir = 'D:/git'
Make sure you use forward slashes in your path
Remove the # at the beginning of the line to allow the line to execute
Using docker and the images maintained by the Jupyter team:
docker run -v `pwd`:/home/jovyan -p 8890:8888 jupyter/scipy-notebook

execution error when opening Jupyter notebook through terminal

I install Jupyter notebook with anaconda, and then to open Jupyter notebook in iterm2 on my Mac. However, some error occurs:
[I 23:55:35.354 NotebookApp] 0 active kernels
[I 23:55:35.354 NotebookApp] The Jupyter Notebook is running at:http://localhost:8888/? token=cd4638d30319d5e08fc7aebf56f395e5e3b88967c82798a3
[I 23:55:35.354 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 23:55:35.364 NotebookApp]
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?token=cd4638d30319d5e08fc7aebf56f395e5e3b88967c82798a3
0:97: execution error: “"http://localhost:8888/tree?token=6ff6e52b1c221edfae2dede83f5cdc282959679ee4c5e3a5"”不理解“open location”信息。 (-1708)
The Chinese information at last means' can't understand the information of 'open location''.
Who can help me to settle this, thanks.
ps. If I input the address in safari, I can get in the page of Jupyter notebook and use it without any problem. But why couldn't I open Jupiter notebook through the terminal?

Jupyter has 0 active kernels (Anaconda with Python 2.7)

I've installed Anaconda 2.5 w/Python 2.7. Upon launching jupyter (which is bundled in Anaconda), the python kernel isn't being detected.
The web server launches and listens on 8888. The browser notebook editor works fine. However, I can't run any python code. The "Cell" menu isn't appearing.
Is there a configuration file or something that needs to be installed?
Here's the output from the console:
[I 21:32:27.625 NotebookApp] Serving notebooks from local directory: C:\Users\smilesydney
[I 21:32:27.625 NotebookApp] **0 active kernels**
[I 21:32:27.625 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/
[I 21:32:27.627 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
The default port 8888 is blocked, I think.
For single launch this should help:
jupyter notebook --port=8889
To fix that permanently run:
jupyter notebook --generate-config
Then go to ./anaconda/ directory and add
c = get_config()
c.NotebookApp.port = 8889
to file jupyter_notebook_config.py
I fixed that through upgrading the Jupyter in Anaconda.
See https://github.com/jupyter/notebook/issues/2382 for more details.
I had the same issue. Reinstalling ipython solved the problem.
Simply restart the jupyter notebook solved the problem for me.
If one restart doesn't help, restart it again.

Resources