ModuleNotFouneError

I am referring to the lesson on embeddings

I get a ModuleNotFoundError for the following import statement

from utils import umap_plot

Where can I find utils?

1 Like

Hi @ugmurthy,

Go to the lecture page and wait for the lab to load. Once it loads, click File --> Open... on the top left. This should open your workspace in a new tab, where you’ll be able to see and download all of the relevant files required by the notebook.

Cheers,
Mubsi

Thanks but that did not work - I get a 502 BAD GATEWAY ERROR

Try again in a while.

Hi @ugmurthy

Welcome to the community.

I faced the same issues, looks like that it is a problem with gradio. I don´t have sure.

Anyway, i tried a couple times and works fine for me.

You also can try to reset the kernel and clean all outputs.

I hope this help

Hi everyone. I have the same problem, but on my local machine. I downloaded the Notebook of this lesson, installed all necessary libraries and, when I try to run:

from utils import umap_plot

I obtain the next error:

ImportError: cannot import name ‘umap_plot’ from ‘utils’ (D:\anaconda3\Lib\site-packages\utils_init_.py)

I have investigated both the modules utils and python-utils, but I cannot find the function or attribute umap_plot. It looks like an error of python version used to do the lesson, but I’m not sure.

Hi @rich-coding, please do this in order to get the files.

1 Like

Thanks @Mubsi, I didn’t know that utils was a file *.py in the Notebook’s root. Now it’s working on my local machine.

Thank you again.

I attache file here in case of someone else need it. (This is only for Lesson 2 Embeddings. For Lesson 3 Dense_Retrieval, you need to download the utils.py as Mubsi describes above.)
utils.py (2.9 KB)