Problem importing module

Srikant91Dev
Hi, I have installed kiteconnect in Ubuntu (pip install kiteconnect) and my installation is all ok. i am unable to import it from Python terminal and gets below error message. Could you please help resolving it.


root@srikant-VirtualBox:~#
root@srikant-VirtualBox:~# python
Python 3.7.7 (default, Apr 18 2020, 02:59:53)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>>
>>> from kiteconnect import KiteConnect
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.7/dist-packages/kiteconnect/__init__.py", line 111, in
from kiteconnect.ticker import KiteTicker
File "/usr/local/lib/python3.7/dist-packages/kiteconnect/ticker.py", line 18, in
from twisted.internet import reactor, ssl
File "/usr/local/lib/python3.7/dist-packages/twisted/internet/ssl.py", line 59, in
from OpenSSL import SSL
File "/usr/local/lib/python3.7/dist-packages/OpenSSL/__init__.py", line 8, in
from OpenSSL import crypto, SSL
File "/usr/local/lib/python3.7/dist-packages/OpenSSL/crypto.py", line 12, in
from cryptography import x509
File "/usr/lib/python3/dist-packages/cryptography/x509/__init__.py", line 8, in
from cryptography.x509.base import (
File "/usr/lib/python3/dist-packages/cryptography/x509/base.py", line 18, in
from cryptography.x509.extensions import Extension, ExtensionType
File "/usr/lib/python3/dist-packages/cryptography/x509/extensions.py", line 20, in
from cryptography.hazmat.primitives import constant_time, serialization
File "/usr/lib/python3/dist-packages/cryptography/hazmat/primitives/constant_time.py", line 11, in
from cryptography.hazmat.bindings._constant_time import lib
ModuleNotFoundError: No module named '_cffi_backend'
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

root@srikant-VirtualBox:~# pip show kiteconnect
Name: kiteconnect
Version: 3.8.2
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: /usr/local/lib/python3.7/dist-packages
Requires: requests, six, pyOpenSSL, enum34, python-dateutil, autobahn
Required-by:
root@srikant-VirtualBox:~#

Thanks,
Srikant
  • rakeshr
    @Srikant91Dev
    ModuleNotFoundError: No module named '_cffi_backend'
    You need to install cffi. pip install cffi
    If it throws already installed message. Then you need to uninstall using pip uninstall cffi and then install again using pip install cffi
Sign In or Register to comment.