ModuleNotFoundError: No module named 'fyers_api.Websocket'

Hi Team,

I am getting module not found error while trying to import 

from fyers_api import fyersModel
from fyers_api.Websocket import ws
 

Following are the version of the packages that I am using

websocket               0.2.1
websocket-client        1.2.1
websockets                8.1
fyers-apiv2             2.0.4

Can some one help me figure out why this is the case?





Posting the entire code, if that helps
 

from fyers_api import fyersModel

from fyers_api.Websocket import ws

from dotenv import dotenv_values

 

 

ENV_DATA = dotenv_values(".env")

IS_TESTING = ENV_DATA.get('TESTING')

access_token = 'My token'

client_id=ENV_DATA.get('CLIENT_ID')

Log_Path = ENV_DATA.get('LOG_PATH') if IS_TESTING == '1' else ENV_DATA.get('LOG_PATH_SERVER')

 

fyers = fyersModel.FyersModel(token=access_token,is_async=False,client_id=client_id)

 

def run_process_background_symbol_data(access_token):

   data_type = "symbolData"

   symbol =["NSE:NIFTY50-INDEX","NSE:NIFTYBANK-INDEX","NSE:SBIN-EQ","NSE:HDFC-EQ","NSE:IOC-EQ"]

   fs = ws.FyersSocket(access_token=access_token,run_background=True,log_path="/home/Downloads/")

   fs.websocket_data = custom_message

   fs.subscribe(symbol=symbol,data_type=data_type)

   print(fyers.get_profile())

   fs.keep_running()

 

def run_process_background_order_update(access_token):    

   data_type = "orderUpdate"

   fs = ws.FyersSocket(access_token=access_token,run_background=True,log_path="/home/Downloads/")

   fs.websocket_data = custom_message

   fs.subscribe(data_type=data_type)

   fs.keep_running()

 

def custom_message(msg):  

   print (f"Custom:{msg}")  

 

def main():

   access_token_websocket= f"{client_id}:{access_token}"

   run_process_background_symbol_data(access_token_websocket)

   run_process_background_order_update(access_token_websocket)

 

if __name__ == '__main__':

main()