Week 1 Assignments missing library

I prefer to work offline, downloading the lab files and opening it in visual studio code, where is more easy to debug the code… in course 1 i’ve do this way… the thing is, in course 2 assignments, at least in week 1, the public_test.py includes a library dlai_tools.testing_utils.
is there a way to get this library to be able to work offline?

You need to download all the files associated with the assignment. There is a topic about that on the DLS FAQ Thread. You also need to get compatible versions of the various python packages that are used, but we do not have any official instructions for how to do that. Here’s a thread which gives some guidance, but it may take some persistence to get through all that. Note that the course environment is provided for you and it works. If you want to set up your own environment, then it requires that you have the IT skills to get that to work. Here’s another thread with some different information on that general topic.

I’ve already downloaded all the files associated with the assignment, but the missing library “dlai_tools” is not included there… and I’ve already set up my environment using anaconda, where all the major libs needed for the assignments are included (numpy, pandas, jupyter, etc.).
The missing library is obviously part of the grading system, or an internal coursera lib…

I think you must have an old version of those files. I updated to the latest and examined both the public_tests.py files in the Week 2 assignments and I don’t see any reference to dlai_tools.

I’ve followed this procedure to update the lab files to the most recent version, and I’m still getting the same error in the external editor, public_tests.py still calls the missing library:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-9c5bb81a785f> in <module>
      3 import sklearn
      4 import sklearn.datasets
----> 5 from public_tests import single_test, multiple_test
      6 from init_utils import sigmoid, relu, compute_loss, forward_propagation, backward_propagation
      7 from init_utils import update_parameters, predict, load_dataset, plot_decision_boundary, predict_dec

~/Documents/Deep Learning Specialization/Course 2/Week 1/W1A1/public_tests.py in <module>
      1 import numpy as np
----> 2 from dlai_tools.testing_utils import single_test, multiple_test
      3 
      4 
      5 def initialize_parameters_zeros_test(target):

ModuleNotFoundError: No module named 'dlai_tools'

in fact is true, the first lines in public_test.py (the updated version) are:

import numpy as np
from dlai_tools.testing_utils import single_test, multiple_test


def initialize_parameters_zeros_test(target):
    layer_dims = [3,2,1]
    expected_output = {'W1': np.array([[0., 0., 0.],
        [0., 0., 0.]]),
 'b1': np.array([[0.],
        [0.]]),
 'W2': np.array([[0., 0.]]),
 'b2': np.array([[0.]])}

Oh, sorry, I missed the fact that you were talking about Course 2. You’re right that is what the file looks like. I was looking at C1 W2.

Well, those files must be there in the local file system or those import commands would fail. Try getting a terminal on the Docker image and then use your linux “chops” to find the files:

find / -type d -name dlai_tools

You’ll find them and then you can tar them up and download them.

I Was able to do it! thanks you very much for your kind support

jovyan@6d2779d709b5:~/work$ find / -type d -name dlai_tools
find: ‘/root’: Permission denied
find: ‘/proc/tty/driver’: Permission denied
find: ‘/proc/1/task/1/fd’: Permission denied
find: ‘/proc/1/task/1/fdinfo’: Permission denied
find: ‘/proc/1/task/1/ns’: Permission denied
find: ‘/proc/1/fd’: Permission denied
find: ‘/proc/1/map_files’: Permission denied
find: ‘/proc/1/fdinfo’: Permission denied
find: ‘/proc/1/ns’: Permission denied
find: ‘/proc/7/task/7/fd’: Permission denied
find: ‘/proc/7/task/7/fdinfo’: Permission denied
find: ‘/proc/7/task/7/ns’: Permission denied
find: ‘/proc/7/fd’: Permission denied
find: ‘/proc/7/map_files’: Permission denied
find: ‘/proc/7/fdinfo’: Permission denied
find: ‘/proc/7/ns’: Permission denied
find: ‘/proc/8/task/8/fd’: Permission denied
find: ‘/proc/8/task/8/fdinfo’: Permission denied
find: ‘/proc/8/task/8/ns’: Permission denied
find: ‘/proc/8/fd’: Permission denied
find: ‘/proc/8/map_files’: Permission denied
find: ‘/proc/8/fdinfo’: Permission denied
find: ‘/proc/8/ns’: Permission denied
find: ‘/etc/ssl/private’: Permission denied
find: ‘/var/cache/ldconfig’: Permission denied
find: ‘/var/cache/apt/archives/partial’: Permission denied
/opt/conda/lib/python3.7/site-packages/dlai_tools
jovyan@6d2779d709b5:~/work$ cd /opt/conda/lib/python3.7/site-packages/dlai_tools
jovyan@6d2779d709b5:/opt/conda/lib/python3.7/site-packages/dlai_tools$ ls
custom_grader.py      __init__.py  test_custom_grader.py  test_testing_utils.py  test_utils.py
deploy_assignment.py  __pycache__  testing_utils.py       test_toc.py            toc.py
jovyan@6d2779d709b5:/opt/conda/lib/python3.7/site-packages/dlai_tools$ cd ~
jovyan@6d2779d709b5:~$ ls
work  work-ro
jovyan@6d2779d709b5:~$ cd wor
bash: cd: wor: No such file or directory
jovyan@6d2779d709b5:~$ cd work
jovyan@6d2779d709b5:~/work$ ls
release
jovyan@6d2779d709b5:~/work$ tar -czf dlai.tar.gz /opt/conda/lib/python3.7/site-packages/dlai_tools/*
tar: Removing leading `/' from member names
jovyan@6d2779d709b5:~/work$ ls
dlai.tar.gz  release
jovyan@6d2779d709b5:~/work$