Run optional labs locally: Type Error

I’ve been completing labs online but decided that I’d like to also run the optional labs locally to make sure I can. I started with C2_W1_Lab01, and downloaded all the files (I have Jupyter, tensorflow, etc. working on my local machine). Unfortunately, when I load the .ipynb file and try to step through it, the very first code cell fails on the import from lab_utils_common.py:

from lab_utils_common import dlc

I get a “TypeError” with the message: “the ‘package’ argument is required to perform a relative import for ‘./deeplearning’”

I’ve experimented and this error shows up a few times, all when the following line of code is executed:

plt.style.use(‘./deeplearning.mplstyle’)

This is odd because I’m launching jupyter-lab from the directory in which the deeplearning.mplstyle file exists, AND that directory is in the PATH so I’m not sure why this is a problem.

I’m normally a Mac person running all this on Windows, so sorry if I’m doing something obviously wrong.

Has anyone else experienced this error? If so, any solutions?

Thanks!

You have to be sure you have compatible versions of all of the tools. In particular, Coursera Labs does not necessarily use the latest versions of anything.

See the FAQ, it discusses this topic:

Specifically, item C.4.