I have been trying to setup a simple bot to test python on my computer. I am getting a message that I am not sure how to troubleshoot and I haven’t found a similar problem posted. am using a code which uses the following code

import gspread
from twitter import *

consumer_key = ‘myapikey’
consumer_secret = ‘myapitoken’
token = ‘myapitoken’
token_secret = ‘myapisecrettoken’

gc = gspread.service_account(‘credentials.json’)
t = Twitter(
auth=OAuth(token, token_secret, consumer_key, consumer_secret))

Get your “home” timeline

t.statuses.home_timeline()

Open a sheet from a spreadsheet in one go

wks = gc.open(“twitterbot”).sheet1

Update a range of cells using the top left corner address

next_tweet = wks.acell(‘A2’).value

delete row on success

wks.delete_rows(2)

and I am getting this error when trying to execute the following:

venv python3 main.py

output:
Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/twitter/api.py”, line 375, in _handle_response
handle = urllib_request.urlopen(req, **kwargs)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py”, line 216, in urlopen
return opener.open(url, data, timeout)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py”, line 525, in open
response = meth(req, response)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py”, line 634, in http_response
response = self.parent.error(
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py”, line 563, in error
return self._call_chain(*args)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py”, line 496, in _call_chain
result = func(*args)
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py”, line 643, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden

please any help would be greatly appreciated!