Navigation

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

    Authentication: AB1007 and Mac Format

    Python SDK
    4
    7
    83
    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.
    • Ramesh 0
      Ramesh 0 last edited by

      Hello team,

      As I am going through the documentation and just getting started, I am facing some issue and would appreciate some clarifications. Here is my code:
      cc83b4c1-f69a-4eb3-9bb9-2cbf8911e823-image.png ![alt text](image url)

      Can somebody tell me if the local IP and the MAC address pulled is correct with the code?
      Running the above code gives me the below error:

      4776211e-4084-46f0-be91-d7be9297671e-image.png

      Any help will be highly appreciated.
      Thank you.

      A 1 Reply Last reply Reply Quote 0
      • A
        admin @Ramesh 0 last edited by

        HI @A224819, please refer the example at below URL: https://github.com/angelbroking-github/smartapi-python

        Ramesh 0 1 Reply Last reply Reply Quote 0
        • Ramesh 0
          Ramesh 0 @admin last edited by

          @admin Thank you.

          I have tried using the suggested approach, and you told me in the other post to follow this page to solve the 'twisted' module not found error. I did use the below to install it:

          pip install twisted
          

          but later it threw this error:

          26d700f1-0b9f-4fb4-bda3-da860965a0f3-image.png

          I will be posting all my issues on this thread so that it may serve as a 'refer-to' guide for many beginners. For tall the beginners I will try my best to assist as I progress with the development, so any reply here from the tech experts will be highly appreciated 🙂

          Thank you so much 🙂

          N 1 Reply Last reply Reply Quote 0
          • N
            NST @Ramesh 0 last edited by

            @A224819 Please try pip install pyOpenSSL

            Ramesh 0 1 Reply Last reply Reply Quote 0
            • Ramesh 0
              Ramesh 0 @NST last edited by

              @sandipkhairnar I have tried that. I have also tried switching the linux distro altogether. I am currently only Feren OS from Lubuntu.
              I have tried installing pyOpenSSL:
              0affbff8-d92d-4075-851c-2ace2fb81a4c-image.png

              However, there is one thing that baffles me and I would like @admin to take note of this issue:

              When I run the below code on PyCharm, it throws the old error - same as above (OpenSSL not found):

              from smartapi.smartConnect import SmartConnect
              

              b928e9c0-dc25-4c40-8f53-ceb5669d7065-image.png

              But, when I run the same command in the terminal, the first time it shows me error and the second time, it runs just fine:
              06ea8ddf-ee40-4774-bdee-59056f70a83a-image.png

              What perplexes me is that why:

              1. The code has to be run twice for it to work in the terminal
              2. Why does the import throw error in the PyCharm IDE.

              Guys, am I the only one facing this issue? If someone was get around this, can you please help me with it? I have been trying to play with this for days now but no luck.

              @admin please suggest an appropriate way out. I have literally changed the distro and typing this from the new linux distro as it did not work here as well.

              Thank you so much.

              Regards,
              Ahmed

              F 1 Reply Last reply Reply Quote 0
              • F
                ForumUser_1 @Ramesh 0 last edited by

                @A224819 the issue with pycharm could be python path which it is using. Maybe try using different environment altogether like Spyder or jupyter? who knows it may work there. By the way, if you just follow startup guide on git page, that should get you going (instead of getting headers/mac address etc.)

                Ramesh 0 1 Reply Last reply Reply Quote 0
                • Ramesh 0
                  Ramesh 0 @ForumUser_1 last edited by

                  Hello, @prateekjjw001 @sandipkhairnar @admin

                  As suggested, I tried using another IDE (Spyder3) and was still getting the same error. So, clearly it wasn't to do with the IDE. I just dug deeper into this and was able to SUCCESSFULLY fix this issue by installing two additional pip requirements. Hence, anyone getting 'No Module found: twisted' error should first install twisted using the below command:

                  pip3 install twisted
                  

                  Then, if you get the 'No module found: OpenSSL' or 'No module found: autobahn'. Try the below codes. I don't know if the first one is necessary but I used it to fix my issue so probably it may help others too:

                  pip install pyOpenSSL
                  

                  The other two which helped me get out of this headache I had since days were:

                  pip3 install service_identity
                  pip3 installed autobahn twisted
                  

                  Thank you all for your help so far 🙂

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