your account is blocked then ative to your account then try login procees is esy after this code is ueful for u apiKey="yyyyyyy" qrOtp = "xxxxxxxx" totp = pyotp.TOTP(qrOtp) totp = totp.now() smartapiObj =SmartConnect(apiKey) data = smartapiObj.generateSession(client_code,client_pass,totp) print(data)