If you start a new session of Jupyter Notebook via the Terminal and you see something like "port 8888 is already in use", then a new port would be selected (usually 8889) you should be able to use your Notebooks on the web browser.
[I 06:07:28.137 NotebookApp] The port 8888 is already in use, trying another port.
[I 06:07:28.138 NotebookApp] Serving notebooks from local directory: /Users/c2ctechtv/Desktop/myproj2
[I 06:07:28.138 NotebookApp] Jupyter Notebook 6.5.4 is running at:
[I 06:07:28.138 NotebookApp] http://localhost:8889/?token=54e40f447444e0df392e94d5c6e2f389b6a756071a6e0300
[I 06:07:28.138 NotebookApp] or http://127.0.0.1:8889/?token=54e40f447444e0df392e94d5c6e2f389b6a756071a6e0300
[I 06:07:28.138 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
If you want to know what's running at port 8888, you can run the below command in the Terminal.
% jupyter notebook list
Currently running servers:
http://localhost:8889/?token=54e40f44744...6a756071a6e0300 :: /Users/c2ctech/Desktop/myproj2
http://localhost:8888/?token=a777de...1343206cb92337b48d06 :: /Users/c2ctech/Desktop/myproj2)
As you can see, I have a Jupyter Notebook running on Port 8888
If you want to kill the session running on port 8888, do the following,
% lsof -t -i :8888
705
12538
Identify the PID for the port 8888 and run the kill -9 command.
% kill -9 12538
Facing issues? Have Questions? Post them here! I am happy to answer!
Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.
Follow him on: X
You can also reach out to him via e-mail: rakesh@code2care.org
- How to convert int to ASCII in Python
- How to make use of SQLite Module in Python?
- Split a String into Sub-string and Parse in Python
- Python: Pandas Rename Columns with List Example
- How to run Python file from Mac Terminal
- How to Exit a Loop in Python Code
- Python: How to Plot a Histogram using Matplotlib and data as list
- MD5 Hashing in Python
- Jupyter: Safari Cant Connect to the Server localhost:8888/tree
- Fix: AttributeError: str object has no attribute decode. Did you mean: encode?[Python]
- How to Read a binary File with Python
- How to add two float numbers in Python
- Python: How to install YAML Package
- Python: How to Save Image from URL
- What is Markdown in Jupyter Notebook with Examples
- How to change the Python Default version
- 33: Python Program to send an email vid GMail
- How to comment code in Python
- How to Fix AttributeError in Python
- Fix: error: Jupyter command `jupyter-nbconvert` not found [VSCode]
- How to comment out a block of code in Python
- List of All 35 Reserved Keywords in Python Programming Language 3.11
- Import Other Python Files Examples
- Python: How to add Progress Bar in Console with Examples
- 3 Ways to convert bytes to String in Python
- Fix Error - Another active Homebrew update process is already in progress - MacOS
- Removing a key from Python Dict - Python
- How to replace   with space - HowTos
- 3 Examples to read a text file line by line using java - Java
- macOS: Remove Desktop or Documents Folder from iCloud Drive Syncing - MacOS
- JDBC SQLException Statement.executeQuery() cannot issue statements that do not produce result sets - Java
- [Fix] Access Denied - GoDaddy Website Firewall - IP Blocked - HowTos
- PowerShell 1..10 foreach Example - Powershell