[PYTHON] I want to start a jupyter environment with one command

Introduction

In rare cases, we ask people who haven't built a Python environment to "Open Jupyter!".

At that time

It is very difficult to ask for such things. (Because sometimes it is an unintended error)

Let's use Docker!

It is assumed that Docker is included, but if Docker is included, it will start up with one command

Install Docker on macOS with Homebrew and Hello world

How to launch and access Jupyter with Docker

Docker image is https://hub.docker.com/r/jupyter/datascience-notebook/ I will borrow from. Since most of the necessary libraries such as pandas are included, you can analyze and draw without stress, although it consumes a lot of space.

Below Usage.

docker run -d --name notebook -v $PWD:/home/jovyan -p 9999:8888 jupyter/datascience-notebook
docker logs notebook 2>&1 | grep 'http://127.0.0.1:8888/?token=' 2>&1 | sed -e "s/^.*token=\(.*\).*$/\1/" 2>&1 | sed -n -e \$p
docker stop notebook && docker rm notebook
docker system prune

Docker garbage removal

When creating an environment using Docker, if you make various trials and errors, garbage will accumulate and you may rarely eat about 50GB. It's okay if you do the basic docker system prune regularly, but also refer to the articles around here!

Docker batch delete command summary

Recommended Posts

I want to start a jupyter environment with one command
I want to use a virtual environment with jupyter notebook!
I want to blog with Jupyter Notebook
I want to build a Python environment
I want to make a game with Python
I want to start over with Django's Migrate
I tried to start Jupyter with Amazon lightsail
I want to write to a file with Python
I want to transition with a button in flask
I want to climb a mountain with reinforcement learning
I want to easily build a model-based development environment
I want to work with a robot in python.
I want to split a character string with hiragana
I want to manually create a legend with matplotlib
I want to send a business start email automatically
I want to run a quantum computer with Python
I want to bind a local variable with lambda
I want to make a blog editor with django admin
I want to start a lot of processes from python
I want to make a click macro with pyautogui (desire)
I want to make a click macro with pyautogui (outlook)
I want to install a package from requirements.txt with poetry
I want to do ○○ with Pandas
[Visualization] I want to draw a beautiful graph with Plotly
I want to debug with Python
I want to set up a GUI development environment with Python or Golang on Mac
How to batch start a python program created with Jupyter notebook
If you want to become a data scientist, start with Kaggle
I want to use a wildcard that I want to shell with Python remove
I wanted to create a smart presentation with Jupyter Notebook + nbpresent
I want to run Rails with rails s even in vagrant environment
I want to do a full text search with elasticsearch + python
[Introduction] I want to make a Mastodon Bot with Python! 【Beginners】
I want to detect objects with OpenCV
I want to print in a comprehension
I want to pip install with PythonAnywhere
I want to analyze logs with Python
I want to play with aws with python
I wanted to use jupyter notebook with docker in pip environment (opticspy)
(Matplotlib) I want to draw a graph with a size specified in pixels
I was addicted to creating a Python venv environment with VS Code
Environment maintenance made with Docker (I want to post-process GrADS in Python
I made a tool to convert Jupyter py to ipynb with VS Code
I tried to build a Mac Python development environment with pythonz + direnv
When generating a large number of graphs with matplotlib, I do not want to display the graph on the screen (jupyter environment)
I want to make matplotlib a dark theme
I want to easily create a Noise Model
I want to use MATLAB feval with python
I want to INSERT a DataFrame into MSSQL
I want to create a window in Python
Start Django in a virtual environment with Pipenv
I want to mock datetime.datetime.now () even with pytest!
I want to display multiple images with matplotlib.
I want to knock 100 data sciences with Colaboratory
I want to be an OREMO with setParam!
I don't want to take a coding test
I want to analyze songs with Spotify API 1
I want to use Temporary Directory with Python2
I don't want to use -inf with np.log
#Unresolved I want to compile gobject-introspection with Python3
I want to create a plug-in type implementation