login error

Introduction Websocket section

--------------------------------------------------------------------------- NameError Traceback (most recent call last) Cell In[90], line 9 1** from** fyers_apiv3.FyersWebsocket import data_ws 3** fyers = data_ws.FyersDataSocket( 4 access_token=“6J5PBSUZWK-100:eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcGkuZnllcnMuaW4iLCJpYXQiOjE3MjU0MjMyNzAsImV4cCI6MTcyNTQ5NjIzMCwibmJmIjoxNzI1NDIzMjcwLCJhdWQiOlsieDowIiwieDoxIiwiZDoxIiwiZDoyIiwieDowIl0sInN1YiI6ImFjY2Vzc190b2tlbiIsImF0X2hhc2giOiJnQUFBQUFCbTE5Nm1OLWlVLXlNMEJSRGZJMnlhejZKMlRpMzBLZVBuTXBZSFhYLVgydy1YS0U1UWVYMFdqMThPajRPUFB4UFYtU0N1TVhsQWNiYWJWOUtSLTZNQ3J1c0xEclh3czg3LU5veUowYS1TTEZTMTFMRT0iLCJkaXNwbGF5X25hbWUiOiJBU0hJU0ggSCBQQVRFTCIsIm9tcyI6IksxIiwiaHNtX2tleSI6ImM4ZWE1YWQ4ZGFiMzkyNzFlNGIzMzM0YjJmNDY3ZjEyMzFkOGJhZDRkMTRmZTdkZWE0ODAxZTYwIiwiZnlfaWQiOiJYQTAwNTIzIiwiYXBwVHlwZSI6MTAwLCJwb2FfZmxhZyI6IlkifQ.X–EWxJM7vFUMR2Fi6kSZTs5mfVQ6sjez9p5RYPoKZc”, # Access token in the format “appid:accesstoken”** 5** log_path=“”, # Path to save logs. Leave empty to auto-create logs in the current directory.** 6** litemode=False**, # Lite mode disabled. Set to True if you want a lite response. 7** write_to_file=False**, # Save response in a log file instead of printing it. 8** reconnect=True**, # Enable auto-reconnection to WebSocket on disconnection. ----> 9 on_connect=onopen, # Callback function to subscribe to data upon connection. 10** on_close=onclose, # Callback function to handle WebSocket connection close events.** 11** on_error=onerror, # Callback function to handle WebSocket errors.** 12** on_message=onmessage, # Callback function to handle incoming messages from the WebSocket.** 13** reconnect_retry=10 # Number of times reconnection will be attepmted in case** 14** ) **NameError: name ‘onopen’ is not defined

Hey @102192878056785717815

Could you please elaborate on the issue being faced

this error is resolved, now a new error is coming from the above headers

import sqlite3
from datetime import datetime
import pytz
from fyers_apiv3.FyersWebsocket import data_ws
import schedule
import time

--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) Cell In[1], line 4 2** from** datetime import datetime 3** import** pytz ----> 4 from fyers_apiv3.FyersWebsocket import data_ws 5** import** schedule 6** import** time File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/fyers_apiv3/FyersWebsocket/data_ws.py:7 4** import** time 5** from** typing import Optional, Callable ----> 7 from pkg_resources import resource_filename 8** import** requests 9** import** urllib.parse File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pkg_resources.py:21 19** import** time 20** import** re —> 21 import imp 22** import** zipfile 23** import** zipimport ModuleNotFoundError: No module named ‘imp’

it was working this morning

all of a sudden this error is coming

i tried different versions of python but error is the same

new error i got toady above error is resolved thanks.


ModuleNotFoundError Traceback (most recent call last)

Cell In[1], line 4

  2 from datetime import datetime

  3 import pytz

----> 4 from fyers_apiv3.FyersWebsocket import data_ws

  5 import schedule

  6 import time

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/fyers_apiv3/FyersWebsocket/data_ws.py:7

  4 import time

  5 from typing import Optional, Callable

----> 7 from pkg_resources import resource_filename

  8 import requests

  9 import urllib.parse

File /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pkg_resources.py:21

 19 import time

 20 import re

—> 21 import imp

 22 import zipfile

 23 import zipimport

ModuleNotFoundError: No module named ‘imp’

Modules i am using - python 3.12.5

import sqlite3

from datetime import datetime

import pytz

from fyers_apiv3.FyersWebsocket import data_ws

import schedule

import time

thanks the issue is with anaconda - multiple environrments. i have uninstalled that now the issue is resolved. Tell everyone not to use conda on mac it creates lot of conflicts. i have installed it 3 times eveytime it is creating errors now i have uninstalled it. Thanks for the support.