Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs

    TypeError: 'module' object is not callable

    Test
    0
    2
    13
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      thiyagaraaj last edited by

      Hello Experts,

      I am starting with smartapi today. I am encountering the an error : TypeError: 'module' object is not callable.

      Here is my code:

      from smartapi import SmartConnect
      import pyotp

      Create an instance of SmartConnect

      obj = SmartConnect(api_key="<Api key>")

      Generate session token

      data = obj.generateSession("S50905755", "<Pin number>", pyotp.totp("XXXXXXXXX"))

      Fetch refresh token

      refreshtoken = data['data']['refreshToken']

      Fetch feed token

      feedtoken = obj.getfeedToken()
      print(feedtoken)

      when i execute this, i get the below error:

      Traceback (most recent call last):
      File "C:/Users/thiyagu/PycharmProjects/pythonProject/stockmarket/angelone.py", line 9, in <module>
      data = obj.generateSession("S50905755", "<pin number>", pyotp.totp("XXXXXXXX"))
      TypeError: 'module' object is not callable

      Any help on this please?

      M 1 Reply Last reply Reply Quote 0
      • M
        Moderator_2 @thiyagaraaj last edited by

        Hi @thiyagaraaj

        Apologies for delayed response.
        Kindly consume the recent SDK of smartAPI by reinstalling.
        Please verify on the "import" to debug the "TypeError: 'module' object is not callable at this line" and share us the observation if the issue still occurs.
        https://stackoverflow.com/questions/4534438/typeerror-module-object-is-not-callable

        Thanks & Regards,
        SmartAPI team

        1 Reply Last reply Reply Quote 0
        • First post
          Last post