How should students use the interactive exercises?

When I go to “Kaggle” and run example code I get errors. This also happens with Collab.
Can someone explain how we are expected to use the interactive portions of this course?
I don’t understand what we are expected to do. Reading the chapters and watching the videos makes sense, but the interactive portion doesn’t seem very thought out. The Kaggle exercises don’t seem to direct the student on how to appropriate the code for their own projects, it’s basically just a demonstration. Outside the context of “Kaggle” how do we use this ourselves? Is that question ever answered?

If I have Jupyter Notebook running on my machine, and I want to play with the Kaggle code locally, how do I do that?

Looking at the error message, it seems that the package duckduckgo_search is not installed by default on colab and kaggle. You need to manually install it.

To do so, create a cell above the one with the import statement, with the following code:
!pip install duckduckgo-search

It will install the package on colab or kaggle, and then you will be able to use it.

For more info on the package, see here

1 Like

Have you had any luck yet?

This updated notebook got me very close,

but the duckduckgo_search import is now called DDGS and not ddg_images

so I had to change that also.

1 Like

If you’re using a macbook the following was how I got things running locally as the fast setup repo didn’t work out for me.

  1. Install Python
  2. Install Conda
  3. Create a virtual environment with the python version kaggle is currently using conda create -n is-it-a-bird python=3.10.12 -y -c conda-forge
  4. Activate the environment you created conda activate is-it-a-bird
  5. pip install every package that was imported (or add a requirements.txt file with all your import names and use pip install -r requirements
  6. If you come across errors check against my notebook which needed a few changes from the original due to things like the DDG API changing.
1 Like

I also found this tutorial on setting up VSCode for Python/Jupyter notebooks very useful.

1 Like