Not able to import methods from utils package

Hi,
I am not able to import the authenticate method from the utils package. Faced this issue in cohere course as well where I had to import some method from the utils package only.

Hi @Navneet808,

Have you downloaded the utils.py file from the workspace ?

hi @Navneet808

Welcome to the community.

In order to be able to run utils.py module, you have to download it and store it on your project root path.

  1. Click on the jupyter logo

  2. Then click on the utils.py file

After that, click on the file menu > download

Don’t forget to keep this files on your project root path folder. It will prevent import issues

Best ragards

2 Likes

After upload the utils.py file, another error was reported which is :No module named ‘dotenv’. And i couldn’t find this file.Do you know how to solve this problem? Thank you

After uploading the utils.py file,another error was reported which is No module named 'dotenv.And i couldn’t find this file.Do you how to solve this problem?

Hi @Molly1,

This is the requirements.txt for this course

google-ai-generativelanguage==0.2.0
google-api-core==2.11.0
google-api-python-client==2.94.0
google-auth==2.22.0
google-auth-httplib2==0.1.0
google-auth-oauthlib
google-cloud-aiplatform==1.26.0
google-cloud-bigquery==3.11.0
google-cloud-core==2.3.2
google-cloud-resource-manager==1.10.1
google-cloud-storage==2.9.0
google-crc32c==1.5.0
google-generativeai==0.1.0
google-resumable-media==2.5.0
googleapis-common-protos==1.59.0
vertexai==0.0.1
python-dotenv==1.0.0
scikit-learn==1.2.2
mplcursors==0.5.2
ipympl==0.9.3
tqdm==4.65.0
scann==1.2.9
protobuf==3.19.6
ipython==8.14.0
pandas==2.0.2
pyarrow==12.0.1

Based off of your question, I’m I wrong in assuming you are fairly new to this ? If so, please search how to set up local python environments and how to download packages using requirements.txt. Additionally, in order for these notebooks to run locally for you, you need to set up your google cloud credentials as well.

Best,
Mubsi

Thank you Mubsi. Yeah,i’m new to this course.