not able to install kiteconnect package for python

vpr_prashanth
please help me to install kiteconnect package on python. I did following steps
1. installed Python 3.10.2
2. pip install --upgrade kiteconnect and checked it with pip show kite connect and it shows version 4.0.0
3. used the below code :
  
from kiteconnect import KiteConnect
from kiteconnect import KiteTicker


api_k = ""
api_s = ""

access_token = ""

def get_login(api_k, api_s):
global kws, kite

print("logging into zerodha")
kite = kiteConnect(api_key=api_k)
print("[*] Generate Request Token : ", Kite.login_url())
request_tkn = input("[*] Enter Your Request Token Here : ")
data = kite.generate_session(request_tkn, api_secret=api_s)
kite.set_access_token(data["access_token"])
kws = kiteTicker(api_k, data["access_token"])
print(data['access_token'])

kite.set_access_token(access_token)
kws = kiteTicker(api_k, access_token)

return kite

kite = get_login(api_k, api_s)
print(kite.margins())

execution gives the below error:
H:\learn-python>py zrd_login.py
logging into zerodha
Traceback (most recent call last):
File "zrd_login.py", line 29, in
kite = get_login(api_k, api_s)
File "zrd_login.py", line 15, in get_login
kite = kiteConnect(api_key=api_k)
NameError: name 'kiteConnect' is not defined
  • SRIJAN
    SRIJAN edited March 2022
    The class name is KiteConnect not kiteConnect. You should check before copying something.
  • vpr_prashanth
    Such a silly mistake to do. anyway thank you.
This discussion has been closed.