mikhailklassen / Mining-the-Social-Web-3rd-Edition

The official online compendium for Mining the Social Web, 3rd Edition (O'Reilly, 2018)
Other
923 stars 486 forks source link

Appendix C examples - wrong paths #29

Open antonbabkin opened 5 years ago

antonbabkin commented 5 years ago

Some paths are broken in notebooks/_Appendix C - Python & Jupyter Notebook Tips.ipynb

Starting docker with this command (on Mac):

docker run --rm -p 8888:8888 -v "$PWD"/notebooks:/home/jovyan/notebooks mtsw3e:latest

This code throws FileNotFoundError: [Errno 2] No such file or directory: '/home/jovyan/notebooks/README.md':

shared_folder="/home/jovyan/notebooks"
README = os.path.join(shared_folder, "README.md")

Because README.md is at the root of the repository, but only "/notebooks/" are visible inside of a container.

The following documentation is not accurate as well:

Shared Folders

The Docker container maps the top level directory of your GitHub checkout (the directory containing README.md) on your host machine to its /home/jovyan/notebooks folder and automatically synchronizes files between the guest and host environments as an incredible convenience to you.