1

I've been using the site Kaggle to take some courses on AI, but whenever I try to download one of the exercises and run the code within VS Code, it doesn't work. I will always get an error like this:

<ipython-input-1-76a2777bc721> in <module>
      1 # Set up feedback system
----> 2 from learntools.core import binder
      3 binder.bind(globals())
      4 from learntools.ethics.ex4 import *
      5 import pandas as pd

ModuleNotFoundError: No module named 'learntools'

Is there any way to circumvent this error so I can use Kaggle notebooks on the go?

DualBall
  • 79
  • 2
  • 12
  • @ArunSg I tried to open the link you sent, but it was invalid! – DualBall Jun 04 '21 at 04:52
  • 1
    try this link https://github.com/Kaggle/docker-python . You can also take a look at Docker hub for docker images. – Arun Sg Jun 04 '21 at 09:02
  • @ArunSg Excellent, that link works! But I'm still not sure what I should do with it. Apparently it involves an image? How should I proceed in utilizing these github files? And how do I make sure whatever this is can apply to the individual lessons I'm doing? Btw, feel free to respond with an actual reply so I can give you credit for your answer! – DualBall Jun 04 '21 at 14:46

1 Answers1

0

Step1. Install Docker

Follow the link to install docker in your machine https://docs.docker.com/engine/install

Step2. Download the relevant Docker-file/Docker image.Here in this case use docker pull kaggle/python

Step3: Launch docker container from the folder where you have the notebook using the command below. docker run -v $PWD:/src -p 8888:8888 --rm -it kaggle/python jupyter notebook --no-browser --ip="0.0.0.0" --notebook-dir=/src

Step4: Copy the url from the terminal and paste it in your browser. The url looks something like this http://127.0.0.1:8888/?token=xxxxxxxxx

Arun Sg
  • 51
  • 6
  • Alright, so now at least I know what Docker is. Kind of. But where do I run these commands? I tried the "docker pull kaggle/python" in both cmd and the VS Code terminal, but got this error: Using default tag: latest error during connect: This error may indicate that the docker daemon is not running.: Post "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/images/create?fromImage=kaggle%2Fpython&tag=latest": open //./pipe/docker_engine: The system cannot find the file specified. – DualBall Jun 05 '21 at 16:53
  • if you are using macos you need to launch the docker application before running these commands. – Arun Sg Jun 06 '21 at 12:06
  • I am using Windows 10 unfortunately. – DualBall Jun 07 '21 at 04:07
  • https://stackoverflow.com/questions/40459280/docker-cannot-start-on-windows you can try some of the solutions from the above link – Arun Sg Jun 07 '21 at 10:09
  • I'm finally back! I tried following the cmd and powershell solutions, but no dice :( I still get the same issue regarding the docker daemon. I can't even run the getting started command that Docker itself wants me to try! The farthest I can get is running docker run --help; that's it. The Docker set-up instructions didn't really help, so what should I do next? Is there a particular Docker tutorial you would recommend? – DualBall Jun 14 '21 at 05:27