ImportError: cannot import name 'KiteConnect'

visasimbu
visasimbu edited October 2018 in Python client
I just started with python library and received first line as error. I got this error after executing below commands in my command prompt. I am using windows machine. How can I solve this issue. Kindly help me.

pip install kiteconnect --upgrade --pre
pip install -U pip setuptools


Errr :
from kiteconnect import KiteConnect
ImportError: cannot import name 'KiteConnect'
  • visasimbu
    visasimbu edited October 2018
    @rakeshr While installation I don't receive any errors. I tried to execute one more time and received below response as already installed.

    D:\MyFolder\Python36>pip install kiteconnect --upgrade --pre
    Requirement already up-to-date: kiteconnect in d:\MyFolder\python36\lib\site-packages\kiteconnect-3.7.4-py3.6.egg (3.7.4)
    Requirement already satisfied, skipping upgrade: requests>=2.18.4 in d:\MyFolder\python36\lib\site-packages (from kiteconnect) (2.19.1)
    Requirement already satisfied, skipping upgrade: six>=1.11.0 in d:\MyFolder\python36\lib\site-packages (from kiteconnect) (1.11.0)
    Requirement already satisfied, skipping upgrade: pyOpenSSL>=17.5.0 in d:\MyFolder\python36\lib\site-packages (from kiteconnect) (18.0.0)
    Requirement already satisfied, skipping upgrade: enum34>=1.1.6 in d:\MyFolder\python36\lib\site-packages (from kiteconnect) (1.1.6)
    Requirement already satisfied, skipping upgrade: python-dateutil>=2.6.1 in d:\MyFolder\python36\lib\site-packages (from kiteconnect) (2.7.3)
    Requirement already satisfied, skipping upgrade: autobahn[twisted]>=17.10.1 in d:\MyFolder\python36\lib\site-packages (from kiteconnect) (18.9.2)
    Requirement already satisfied, skipping upgrade: pypiwin32<=220 in d:\MyFolder\python36\lib\site-packages (from kiteconnect) (220)
    Requirement already satisfied, skipping upgrade: idna<2.8,>=2.5 in d:\MyFolder\python36\lib\site-packages (from requests>=2.18.4->kiteconnect) (2.6)
    Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in d:\MyFolder\python36\lib\site-packages (from requests>=2.18.4->kiteconnect) (2018.8.24)
    Requirement already satisfied, skipping upgrade: urllib3<1.24,>=1.21.1 in d:\MyFolder\python36\lib\site-packages (from requests>=2.18.4->kiteconnect) (1.23)
    Requirement already satisfied, skipping upgrade: chardet<3.1.0,>=3.0.2 in d:\MyFolder\python36\lib\site-packages (from requests>=2.18.4->kiteconnect) (3.0.4)
    Requirement already satisfied, skipping upgrade: cryptography>=2.2.1 in d:\MyFolder\python36\lib\site-packages (from pyOpenSSL>=17.5.0->kiteconnect) (2.3.1)
    Requirement already satisfied, skipping upgrade: txaio>=18.8.1 in d:\MyFolder\python36\lib\site-packages (from autobahn[twisted]>=17.10.1->kiteconnect) (18.8.1)
    Requirement already satisfied, skipping upgrade: zope.interface>=3.6.0; extra == "twisted" in d:\MyFolder\python36\lib\site-packages (from autobahn[twisted]>=17.10.1->kiteconnect) (4.4.3)
    Requirement already satisfied, skipping upgrade: Twisted>=12.1.0; extra == "twisted" in d:\MyFolder\python36\lib\site-packages (from autobahn[twisted]>=17.10.1->kiteconnect) (17.9.0)
    Requirement already satisfied, skipping upgrade: asn1crypto>=0.21.0 in d:\MyFolder\python36\lib\site-packages (from cryptography>=2.2.1->pyOpenSSL>=17.5.0->kiteconnect) (0.23.0)
    Requirement already satisfied, skipping upgrade: cffi!=1.11.3,>=1.7 in d:\MyFolder\python36\lib\site-packages (from cryptography>=2.2.1->pyOpenSSL>=17.5.0->kiteconnect) (1.11.2)
    Requirement already satisfied, skipping upgrade: setuptools in d:\MyFolder\python36\lib\site-packages (from zope.interface>=3.6.0; extra == "twisted"->autobahn[twisted]>=17.10.1->kiteconnect) (40.4.3)
    Requirement already satisfied, skipping upgrade: hyperlink>=17.1.1 in d:\MyFolder\python36\lib\site-packages (from Twisted>=12.1.0; extra == "twisted"->autobahn[twisted]>=17.10.1->kiteconnect) (17.3.1)
    Requirement already satisfied, skipping upgrade: incremental>=16.10.1 in d:\MyFolder\python36\lib\site-packages (from Twisted>=12.1.0; extra == "twisted"->autobahn[twisted]>=17.10.1->kiteconnect) (17.5.0)
    Requirement already satisfied, skipping upgrade: Automat>=0.3.0 in d:\MyFolder\python36\lib\site-packages (from Twisted>=12.1.0; extra == "twisted"->autobahn[twisted]>=17.10.1->kiteconnect) (0.6.0)
    Requirement already satisfied, skipping upgrade: constantly>=15.1 in d:\MyFolder\python36\lib\site-packages (from Twisted>=12.1.0; extra == "twisted"->autobahn[twisted]>=17.10.1->kiteconnect) (15.1.0)
    Requirement already satisfied, skipping upgrade: pycparser in d:\MyFolder\python36\lib\site-packages (from cffi!=1.11.3,>=1.7->cryptography>=2.2.1->pyOpenSSL>=17.5.0->kiteconnect) (2.18)
    Requirement already satisfied, skipping upgrade: attrs in d:\MyFolder\python36\lib\site-packages (from Automat>=0.3.0->Twisted>=12.1.0; extra == "twisted"->autobahn[twisted]>=17.10.1->kiteconnect) (17.3.0)

    D:\MyFolder\Python36>
  • rakeshr
    @visasimbu
    Can you check kiteconnect version using pip show kiteconnect?
  • visasimbu
    visasimbu edited October 2018
    @rakeshr Please find the output

    D:\MyFolder\Python36>pip show kiteconnect
    Name: kiteconnect
    Version: 3.7.4
    Summary: The official Python client for the Kite Connect trading API
    Home-page: https://kite.trade
    Author: Zerodha Technology Pvt ltd. (India)
    Author-email: [email protected]
    License: MIT
    Location: d:\MyFolder\python36\lib\site-packages\kiteconnect-3.7.4-py3.6.egg
    Requires: requests, six, pyOpenSSL, enum34, python-dateutil, autobahn, pypiwin32
    Required-by:

    D:\MyFolder\Python36>
  • visasimbu
    visasimbu edited October 2018
    Any help team...

    My python version is 3.6.2 along with Microsoft visual C++ 2015- 14.0

    This is the github url I have followed. Downloaded the setup file from above github url and tried installing manually as well. But still facing same issue.

    This is the log(install_Log.txt) for manual installation.
  • rakeshr
    @visasimbu
    Installation seems fine.Is python file in the same location as of Kite Connect Python Client installation?
    Can you check this at python file(were you getting Import Error) path pip show kiteconnect.
  • visasimbu
    visasimbu edited October 2018
    @rakeshr

    Below is the list of path added in my Windows environment 'path'. Restarted my machine.

    D:\MyFolder\Python36\
    D:\MyFolder\pykiteconnect-kite3\
    D:\MyFolder\Python36\Scripts\


    My program was kept in C drive in below location.
    C:\Users\Simbu\MyWork\Kite_Connect\PyPgm\kiteconnect.py

    I got same error.

    When I move my 'kiteconnect.py' file inside "D:\MyFolder\pykiteconnect-kite3\". Then its working. What went wrong here.
Sign In or Register to comment.