ageron / handson-ml3

A series of Jupyter notebooks that walk you through the fundamentals of Machine Learning and Deep Learning in Python using Scikit-Learn, Keras and TensorFlow 2.
Apache License 2.0
7.68k stars 3.08k forks source link

[BUG] Docker image issue. #109

Open Wang0293 opened 10 months ago

Wang0293 commented 10 months ago

I built the image with make build, and everything goes well. However, when I ran make run, it showed:

[+] Running 1/0 ✔ Container handson-ml3 Created 0.0s Attaching to handson-ml3 handson-ml3 | usage: jupyter [-h] [--version] [--config-dir] [--data-dir] [--runtime-dir] handson-ml3 | [--paths] [--json] [--debug] handson-ml3 | [subcommand] handson-ml3 | handson-ml3 | Jupyter: Interactive Computing handson-ml3 | handson-ml3 | positional arguments: handson-ml3 | subcommand the subcommand to launch handson-ml3 | handson-ml3 | options: handson-ml3 | -h, --help show this help message and exit handson-ml3 | --version show the versions of core jupyter packages and exit handson-ml3 | --config-dir show Jupyter config dir handson-ml3 | --data-dir show Jupyter data dir handson-ml3 | --runtime-dir show Jupyter runtime dir handson-ml3 | --paths show all Jupyter paths. Add --json for machine-readable handson-ml3 | format. handson-ml3 | --json output paths as machine-readable json handson-ml3 | --debug output debug information about paths handson-ml3 | handson-ml3 | Available subcommands: dejavu events execute kernel kernelspec lab handson-ml3 | labextension labhub migrate nbconvert run server troubleshoot trust handson-ml3 | handson-ml3 | Jupyter command jupyter-notebook not found. handson-ml3 exited with code 0

So I tried jupyter --version in the same container bash, and it showed:

Selected Jupyter core packages... IPython : 8.17.2 ipykernel : 6.26.0 ipywidgets : 8.1.1 jupyter_client : 8.6.0 jupyter_core : 5.5.0 jupyter_server : 2.11.2 jupyterlab : 4.0.9 nbclient : 0.8.0 nbconvert : 7.12.0 nbformat : 5.9.2 notebook : not installed qtconsole : not installed traitlets : 5.14.0.0

Obviously, notebook not installed. Maybe some modification needed?

antoooooooooooonie commented 10 months ago

I'm actually getting the same issue when I install the env on MacOS Intel

anthony@*********~/P/handson-ml3> jupyter --version                                         (homl3) 18:40:12
Selected Jupyter core packages...
IPython          : 8.17.2
ipykernel        : 6.28.0
ipywidgets       : 8.1.1
jupyter_client   : 8.6.0
jupyter_core     : 5.6.0
jupyter_server   : 2.12.1
jupyterlab       : 4.0.9
nbclient         : 0.8.0
nbconvert        : 7.13.1
nbformat         : 5.9.2
notebook         : not installed
qtconsole        : not installed
traitlets        : 5.14.0

As you would expect, pip install notebook fixes the issue

ageron commented 8 months ago

Thanks for your feedback, and sorry for the late response. Indeed, adding pip install notebook fixes the issue. Another solution is to switch to Jupyter lab. I've chosen the second option, because I prefer Jupyter lab now, and I updated the Dockerfile and docker-compose.yml, everything should work now. Note that I've also pushed the updated docker image to the Docker hub, so you can just docker pull ageron/handson-ml3:latest or latest-gpu. Thanks again!