Skip to content

Forum in maintenance, we will back soon 🙂

Problem running web...
 
Notifications
Clear all

Problem running web_search.py

6 Posts
3 Users
0 Reactions
257 Views
Evelyne Skorczynski
(@evelyne-skorczynski)
Posts: 3
Active Member Customer
Topic starter
 

I get the following error when trying to run web_search.py from P.E course

 

File "c:\Users\evask\Desktop\AI-PROMPT-ENG-PRACTICES\Course_Files_Github\PE-Course-codes\web_search.py", line 10, in <module>
search_results = serp.search_google(query, 3)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\Users\evask\Desktop\AI-PROMPT-ENG-PRACTICES\Course_Files_Github\PE-Course-codes\serp.py", line 74, in search_google
raise Exception(
Exception: Error: API request failed with status code 401.

image

Thank you

 
Posted : 01/28/2024 11:16 am
SSAdvisor
(@ssadvisor)
Posts: 1139
Noble Member
 

A 401 error means you are not authorized to access. Did you supply an OpenAI API key?

Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack

 
Posted : 01/28/2024 3:57 pm
Evelyne Skorczynski
(@evelyne-skorczynski)
Posts: 3
Active Member Customer
Topic starter
 

@ssadvisor Yes

 
Posted : 01/28/2024 4:19 pm
SSAdvisor
(@ssadvisor)
Posts: 1139
Noble Member
 

@Hasan, is the API key for valueserp.com you have in serp.py file still valid?

Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack

 
Posted : 01/29/2024 1:41 am
Hasan Aboul Hasan
(@admin)
Posts: 1257
Member Admin
 

@ssadvisor no, it is my API key. he should generate his own if he want to use the API

 
Posted : 01/29/2024 11:07 am
SSAdvisor
(@ssadvisor)
Posts: 1139
Noble Member
 

@admin okay, i'll give you a diff to apply for this when I raise an issue in GitHub.

Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack

 
Posted : 01/29/2024 3:41 pm
Share: