How can I install the utils package?

I am running the examples in google colab, but unable to figure out the utils package. I was able to authenticate using google_auth.authenticate_user(), however stuck at the below:

from utils import plot_2D

Thanks.

hi @sanimesa

Welcome to the community.

Some packages might be attached in the course platform.

If you trying to running on your own environment, you have to download all the files related to the course in order to get it work.

For example:

You might be able to access all the stored files by clicking on the jupyter logo at the top-left.

This example above is from another course. Just take as a reference

I hope this help

Best regards
elirod

I almost forgot.

In the course environment, all the authentications/credentials and API keys are stored in the course environment.

That means that if you intended to running in your own environment you have to use your own Google API, authentication/credentials Keys.

One more thing. Don’t forget that some environment variables use python-dotenv package to handle sensitive data. That means that you have to handle the .env file and imports by your self.

Here it is an article explain how to use it in case you need it:

I hope this help

best regards
elirod

Awesome, thanks!

1 Like

You welcome, my friend!

In the course, utils package has no definition for the plot_2D function and some other functions required, I am running on my local machines.

There are different utils.py file versions for each lessons.
To find plot2D function open the “Visualizing Embeding” lesson, then File/ Open…
and open “utils.py” file. There you can see the requred functions.

1 Like

Hi

ImportError: cannot import name ‘authenticate’ from ‘utils’ (/usr/local/lib/python3.10/dist-packages/utils/init.py)
How do i fix this error

Hi @farheen2

Welcome to the community.

If you are running locally you have to setting your environment variable with your own API keys or credentials.

Hi
Yes , I set up my API KEY and other credition . every time i am facing same issue utils is not importing packages

Just to make sure, do you downloaded the untils.py file?

no i didn’t download it. Can you tell if i download it , what would be its path

You can store it on the main path of your project. After that, you can set up your credentials on the appropriate function available on the untils.py file

This might be fix the import error.

Thank you

1 Like

You welcome.

let me know if you need additional help with this situation

Sure
Thank you

1 Like