kiteconnect works everywhere except in Visual Studio 17

anonymous
anonymous edited October 2018 in Python client
Hi,

I'm facing rather unsual issue with kiteconnect. Kiteconnect works fine in command prompt and PyCharm. However, when I import kiteconnect (from kiteconect import KiteConnect) in VS, intellisense highlights it (just 'kiteconnect', not 'KiteConnect' ) saying 'cannot 'resolve' kiteconnect. Intellisense maybe missing this module'.

The weird thing is, I can still use functions like set_access_token(), login_url(), etc. VS throwed nameError when I tried to use exceptions, haven't tested any more features of the library (on VS), yet.

I'm pretty sure my kiteconnect installation(3.7.4) is correct since I can use the same on other IDEs. I've also used other external libs in VS, and they work just fine.

I tried searching about the issue and found that intellisense throws that cannot 'resolve' error when library isn't present in site-packages folder of python. I can confirm that I don't have any kiteconnect folder in site-packages folder. The only kiteconnect related thing I found in /python/python36 is 'kiteconnect-3.7.4-py3.6.egg'. But if this was the problem, kiteconnect shouldn't work in other environments too, right?

Any idea how I can solve this mess? I'm using python 3.6.5(x64) and Win10(x64), if that matters.

Thanks!
  • anonymous
    Figured it out. In case someone faces same issue - just unpack .egg file.
    Mods, feel free to close the thread.
  • anonymous
    anonymous edited October 2018
    Well turns out, I'm still getting nameError for kiteconnect. I'm using following code:

    except kiteconnect.exceptions.TokenException:

    is this correct way to catch exceptions?

    Edit: solved by changing kiteconnect.exceptions.TokenException to exceptions.TokenException
Sign In or Register to comment.