AttributeError: 'module' object has no attribute 'packages'

sham
I am trying to try the connect api's for first time getting the below error when i run below commands.
from kiteconnect import KiteConnect

api_key = "xxxxxx"
api_secret = "xxxxxxxxxxx"

kite = KiteConnect(api_key=api_key)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
in ()
----> 1 kt = KiteConnect(api_key=api_key)

/usr/local/lib/python2.7/dist-packages/kiteconnect/__init__.pyc in __init__(self, api_key, access_token, root, debug, timeout, micro_cache, proxies, pool)
224
225 # disable requests SSL warning
--> 226 requests.packages.urllib3.disable_warnings()
227
228 def set_session_hook(self, method):

AttributeError: 'module' object has no attribute 'packages'
  • Vivek
    Seems like you are using old version of Python requests. Please try upgrading using following command and try again

    pip install --upgrade requests
  • sham
    it worked thanks.
This discussion has been closed.