I'm on Mac OS 10.10.4.
When I run ipython notebook from command line, it gives me an error Cannot bind to localhost, using 127.0.0.1 as default ip [Errno 49] Can't assign requested address:
Yans-MacBook-Pro:/ yanyang$ ipython notebook
[W 01:32:12.908 NotebookApp] Cannot bind to localhost, using 127.0.0.1 as default ip
[Errno 49] Can't assign requested address
[I 01:32:12.912 NotebookApp] Serving notebooks from local directory: /
[I 01:32:12.913 NotebookApp] 0 active kernels
[I 01:32:12.913 NotebookApp] The IPython Notebook is running at: http://127.0.0.1:8888/
[I 01:32:12.913 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
It will cause more error later. How can I fix it?
localhost:~ yanyang$ lsof | grep 8888
Google 358 yanyang txt REG 1,4 16621568 26888859 /Users/yanyang/Library/Caches/Google/Chrome/Profile 5/Cache/data_4
Google 358 yanyang 90u REG 1,4 16621568 26888859 /Users/yanyang/Library/Caches/Google/Chrome/Profile 5/Cache/data_4
Google 358 yanyang 205u REG 1,4 3072 35352297 /Users/yanyang/Library/Application Support/Google/Chrome/Profile 5/Local Storage/http_127.0.0.1_8888.localstorage
Content of the file in the last line of the above block:
?????z!11?tableItemTableItemTableCREATE TABLE ItemTable (key TEXT UNIQUE ON CONFLICT REPLACE, value BLOB NOT NULL ON CONFLICT FAIL)[!}1indexsqlite_aut?S???widgets:http://127.0.0.1:8888/notebooks/Downloads/PhillyCrime.ipynb{}?*?Qwidgets:http://127.0.0.1:8888/notebooks/Users/yanyang/Downloads/PhillyCrime.ipynb{}
??X?
?widgets:http://127.0.0.1:8888/notebooks/Downloads/PhillyCrime.ipynb?&?Q widgets:http://127.0.0.1:8888/notebooks/Users/yanyang/Downloads/PhillyCrime.ipynb
Thanks to #Petesh, I can use ipython notebook temperately now, using the command below:
ipython notebook --ip=127.0.0.1
And for further solution, I found that in my Mac's "/etc/hosts", 127.0.0.1 is not set to localhost. That's the final solution.
Related
I tried everything here and nothing worked:
Jupyter Notebook Server password invalid
How to disable password request for a Jupyter notebook session?
When I generate a password it doesn't give me a token but when I type in the password it doesn't work. When I copy and paste my token, it also doesn't work.
$ jupyter notebook --no-browser
[I 2022-08-04 13:37:32.069 LabApp] JupyterLab extension loaded from ~/anaconda3/lib/python3.9/site-packages/jupyterlab
[I 2022-08-04 13:37:32.069 LabApp] JupyterLab application directory is ~/anaconda3/share/jupyter/lab
[I 13:37:32.073 NotebookApp] Serving notebooks from local directory: /home/jespinoz
[I 13:37:32.073 NotebookApp] Jupyter Notebook 6.4.8 is running at:
[I 13:37:32.073 NotebookApp] http://localhost:8888/?token=469451b2e8ec80432a0948fbbe8662347695efd8f5339307
[I 13:37:32.073 NotebookApp] or http://127.0.0.1:8888/?token=469451b2e8ec80432a0948fbbe8662347695efd8f5339307
[I 13:37:32.073 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 13:37:32.132 NotebookApp]
To access the notebook, open this file in a browser:
file:///home/jespinoz/.local/share/jupyter/runtime/nbserver-3346536-open.html
Or copy and paste one of these URLs:
http://localhost:8888/?token=469451b2e8ec80432a0948fbbe8662347695efd8f5339307
or http://127.0.0.1:8888/?token=469451b2e8ec80432a0948fbbe8662347695efd8f5339307
This did nothing:
c.NotebookApp.token = ''
c.NotebookApp.password = u''
c.NotebookApp.open_browser = True
c.NotebookApp.ip = 'localhost'
Neither did just this:
c.NotebookApp.token = ''
Nor this:
jupyter notebook password
Nor this:
jupyter notebook --ip='*' --NotebookApp.token='' --NotebookApp.password=''
Running one line of code "import pixiedust" makes the kernel die and automatically restart every time I try it. I'm using Jupyter Notebook via Anaconda in MacOS BigSur 11.2.3.
import pixiedust
this is my only line of code, the rest of my code works fine (the part not using pixiedust).
that's the terminal output:
Last login: Sat Mar 27 16:26:47 on ttys001
/Users/avic/opt/anaconda3/bin/jupyter_mac.command ; exit;
(base) avic#Avis-MBP ~ % /Users/avic/opt/anaconda3/bin/jupyter_mac.command ; exit;
[I 16:31:00.239 NotebookApp] JupyterLab extension loaded from /Users/avic/opt/anaconda3/lib/python3.7/site-packages/jupyterlab
[I 16:31:00.239 NotebookApp] JupyterLab application directory is /Users/avic/opt/anaconda3/share/jupyter/lab
[I 16:31:00.242 NotebookApp] Serving notebooks from local directory: /Users/avic
[I 16:31:00.242 NotebookApp] The Jupyter Notebook is running at:
[I 16:31:00.242 NotebookApp] http://localhost:8888/?token=8d705f0c1f4efa59a8d4edc4643ad87ded410f4af2f62ea6
[I 16:31:00.242 NotebookApp] or http://127.0.0.1:8888/?token=8d705f0c1f4efa59a8d4edc4643ad87ded410f4af2f62ea6
[I 16:31:00.242 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 16:31:00.249 NotebookApp]
To access the notebook, open this file in a browser:
file:///Users/avic/Library/Jupyter/runtime/nbserver-57976-open.html
Or copy and paste one of these URLs:
http://localhost:8888/?token=8d705f0c1f4efa59a8d4edc4643ad87ded410f4af2f62ea6
or http://127.0.0.1:8888/?token=8d705f0c1f4efa59a8d4edc4643ad87ded410f4af2f62ea6
[I 16:31:09.251 NotebookApp] Kernel started: b3400759-7e32-4b4d-87c8-77676fafe504
[I 16:31:15.255 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports
kernel b3400759-7e32-4b4d-87c8-77676fafe504 restarted
I've never used this workspace before but I'm required to by my uni...
Please help :)
I'm trying to launch Jupyter notebook from a Docker container and the localhost just won't run on my browser.
Here's my script to run jupyter notebook
#!/bin/bash
# Usage:
# ./run_jupyter.sh [image]
#
# Parameters:
# image - optional. A custom image to use instead of default. If it is given,
# we will not attemp to pull the latest image. This allows local image development.
#
# Container will be removed upon exit, but any jupyter settings and pakcages installed with
# pip install --user are kept in mlcourse.ai/home folder.
# Remove them if you need a completely fresh image.
#
IMAGE=${1:-festline/mlcourse_ai}
#custom port
PORT=4545
# If we are called without a parameter to specify a new image,
# let's make sure we are on the latest image
if [ $# -eq 0 ]; then
echo "Will check for the latest image on the docker hub."
docker pull $IMAGE
fi
exec docker run --rm -u $(id -u):$(id -g) -v "$PWD:/notebooks" -w /notebooks -e HOME=/notebooks/home -p $PORT:8888 $IMAGE jupyter-notebook --NotebookApp.ip=0.0.0.0 --NotebookApp.password_required=False --NotebookApp.token='' --NotebookApp.custom_display_url="http://localhost:$PORT"
# this allows for container to be created and persisted.
# which means that you can keep the changes you made,
# i.e. if you installed more software with pip.
#
# USER_ID=$(id -u) GROUP_ID=$(id -g) GROUP_NAME=$(id -gn) exec docker-compose -f docker/docker-compose.yaml up
When I run the script, this is what it shows on my terminal
[W 07:14:08.593 NotebookApp] All authentication is disabled. Anyone who can connect to this server will be able to run code.
[I 07:14:08.629 NotebookApp] JupyterLab extension loaded from /opt/conda/lib/python3.6/site-packages/jupyterlab
[I 07:14:08.629 NotebookApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
[C 07:14:08.631 NotebookApp] Running as root is not recommended. Use --allow-root to bypass.
The complete output I get when I run the script is:
[W 03:18:04.430 NotebookApp] All authentication is disabled. Anyone who can connect to this server will be able to run code.
[I 03:18:04.631 NotebookApp] JupyterLab extension loaded from /opt/conda/lib/python3.6/site-packages/jupyterlab
[I 03:18:04.631 NotebookApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
[I 03:18:04.635 NotebookApp] Serving notebooks from local directory: /notebooks
[I 03:18:04.635 NotebookApp] The Jupyter Notebook is running at:
[I 03:18:04.636 NotebookApp] http://localhost:4545/
[I 03:18:04.636 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 03:18:04.658 NotebookApp] No web browser found: could not locate runnable browser.
So what I did was copy "http://localhost:4545/" above and paste it into the address box in my browser, and presto a Jupyter notebook comes listing the contents of the directory.
Hope this is useful.
I'm not sure why you're running it as root...
I followed the instructions here.
I am on the Ubuntu VM via SSH.
I tried to access IP:8000 but Chrome says the Site can't be reached. Port 8000 is indeed open by default as mentioned in the docs.
Instructions don't mention if I have to start jupyterhub so I tried that and got this error -
username#fastai:~ $ jupyterhub
[I 2018-04-02 00:25:41.018 JupyterHub app:871] Writing cookie_secret to /home/username/jupyterhub_cookie_secret
[I 2018-04-02 00:25:41.036 alembic.runtime.migration migration:117] Context impl SQLiteImpl.
[I 2018-04-02 00:25:41.037 alembic.runtime.migration migration:122] Will assume non-transactional DDL.
[I 2018-04-02 00:25:41.067 alembic.runtime.migration migration:327] Running stamp_revision -> 3ec6993fe20c
[W 2018-04-02 00:25:41.388 JupyterHub app:955] No admin users, admin interface will be unavailable.
[W 2018-04-02 00:25:41.389 JupyterHub app:956] Add any administrative users to `c.Authenticator.admin_users` in config.
[I 2018-04-02 00:25:41.389 JupyterHub app:983] Not using whitelist. Any authenticated user will be allowed.
[E 2018-04-02 00:25:41.414 JupyterHub app:1525] Failed to bind hub to http://127.0.0.1:8081/hub/
[E 2018-04-02 00:25:41.414 JupyterHub app:1623]
Traceback (most recent call last):
File "/anaconda/envs/py35/lib/python3.5/site-packages/jupyterhub/app.py", line 1621, in launch_instance_async
yield self.start()
File "/anaconda/envs/py35/lib/python3.5/site-packages/jupyterhub/app.py", line 1523, in start
self.http_server.listen(self.hub_port, address=self.hub_ip)
File "/anaconda/envs/py35/lib/python3.5/site-packages/tornado/tcpserver.py", line 142, in listen
sockets = bind_sockets(port, address=address)
File "/anaconda/envs/py35/lib/python3.5/site-packages/tornado/netutil.py", line 197, in bind_sockets
sock.bind(sockaddr)
OSError: [Errno 98] Address already in use
Before I read about jupyterhub in the docs, I tried starting jupyter notebook which gave me this error.
[C 04:00:12.963 NotebookApp] Bad config encountered during initialization:
[C 04:00:12.963 NotebookApp] No such notebook dir: ''/dsvm/Notebooks''
It seemed to run fine after generating a config file using jupyter notebook --generate-config and editing it but I still couldn't reach it via Chrome despite opening up all ports.
UPDATE
Today I installed an X2Go client and found the jupyter notebook icon on the desktop but starting that threw this error -
Failed to run Jupyter.desktop
Failed to parse the desktop file: Key file contains line '/anaconda/pkgs/notebook-5.4.0-py27_0/info/icon.png' which is not a key-value pair, group, or comment
Looks like that file calls jupyter notebook which throws the same error as before.
JupyterHub should be running on port 8000 at startup. Can you double-check its status with systemctl status jupyterhub? And have you double-checked in the portal that port 8000 is open?
If JupyterHub reports that it's running and listening on port 8000, there may be a firewall blocking the connection. Some users have had success with forwarding port 8000 over SSH in this case, then connecting to localhost:8000.
This was caused by a bug which has since been fixed on the later versions of the Deep learning VM.
See this Github issue for more details.
What i have: NanoPi Neo2 (Allwinner A5 (arm v8 x64) processor, 512mb ram)
What I did:
apt-get install docker*
docker pull konmeo/jupyter (got here)
docker run -it --rm -p 8888:8888 4fdcd3a6ff59
it said [C 19:38:32.851 NotebookApp] Running as root is not recommended. Use --allow-root to bypass.
I runned docker run -it --rm -p 8888:8888 4fdcd3a6ff59 /usr/bin/jupyter notebook --allow-root, everything in docker is okay
[W 19:40:36.237 NotebookApp] server_extensions is deprecated, use nbserver_extensions
[I 19:40:36.287 NotebookApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret
[I 19:40:39.827 NotebookApp] hide_code: Attempting to load hid_code export handler extensions.
[I 19:40:39.839 NotebookApp] hide_code: Hide_code export handler extensions loaded.
[I 19:40:39.972 NotebookApp] Loading IPython parallel extension
[I 19:40:40.238 NotebookApp] [jupyter_nbextensions_configurator] enabled 0.2.4
[I 19:40:40.242 NotebookApp] Serving notebooks from local directory: /notebooks
[I 19:40:40.243 NotebookApp] 0 active kernels
[I 19:40:40.244 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/?token=89a3809bd589557e08e31d7fbd475e6e17bb333fe2311745
[I 19:40:40.245 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 19:40:40.248 NotebookApp] No web browser found: could not locate runnable browser.
[C 19:40:40.250 NotebookApp]
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?token=89a3809bd589557e08e31d7fbd475e6e17bb333fe2311745
but I have no access neither using browser on local device nor using http://ip:8888/ in local network
What I should do to make it work?
Try binding docker to all interfaces.
-p 0.0.0.0:8888:8888