Getting error for web socket when create python exe with API V3

Hello,

I am trying to create an exe for a developed python script. After running the script there is no issue but when I create python exe and try to execute it then getting below error.

I am facing this error with API V3 only there is no issue with API V2.

Has anyone tried the same thing? Are you facing the same issue?

Hi @chaitanyakalyani.demat-vbz ,

As you said there is no issue when you are running manually. You are getting these issue when you are making exe file. Try to google these error lines by lines otherwise you can automate your python script.

Hope it will help
Thanks

Hello @Z4PBvkQGyF@shruthi_shetty

I tried to check on Google but was not able to resolve it.

I think V3 has some hidden issues. As a software engineer, I understand it’s new, and identifying and fixing runtime issues will take some time. I hope you will address all the issues and fix them.

After checking memory usage got to know V3 is taking more CPU memory.

Please check the below screenshot. Hint: Socket is only taking more memory

Hi @chaitanyakalyani.demat-vbz

See there are mainly two errors, one is related to tkinter library which you are using for your purpose and second the file not found map.json.
So if you somehow fix both error then your binary will be bulid. One is your from side (tkinter) and second you load the json.
If you are using PyInstaller to build the binary then might be attached answer can you help you.

He is also getting the same error.

https://stackoverflow.com/questions/64822985/why-does-my-exe-generated-by-pyinstaller-not-start

Hope it will help.
Thank you

Hello @desh.5sgxdaeh ,

I left it. I am using code only to run.

Hi @desh.5sgxdaeh
then try another method
You can run normal python. This issue is not related to APIs.
Please search solution over the internet.

Hello @Z4PBvkQGyF ,

I found solution for this. This issue is because of fyers linking of map.json file for web socket.

After creating executable i copied fyers_apiv3 folder into _internal folder.

from python lib-> site-packages then this issue is getting resolved

Need to just copy pest the folder from packages which is not getting copied while generating exe.

Nice @chaitanyakalyani.demat-vbz

One is already reported same thing in community but glad you found it.

Hello @Z4PBvkQGyF ,

thank you.

I am developing algo program for that trying to login using TOTP. After login doing below process but getting error as {‘code’: -429, ‘message’: ‘Request limit reached, refresh after few mins’, ‘s’: ‘error’}.

  • login using TOTP
  • Start websocket
  • Fetch profile
  • Start fetching positions

1 to 3 steps are working fine but getting error fetching positions.

Looks like you have crossed request calls beyond API Rate Limit.
Try adding waits between requests to avoid per minute rate limit blocking.

Refer -
https://myapi.fyers.in/docs/#tag/Request-and-Response-Structure/paths/~1pet~1%7BpetId%7D/get

Hello @nsuyash11-m18,

Thanks for quick response.

Looks like 10000 requests per day is very less.

Do you know how to tackle with this limit ?

As per @communications_team, user is blocked for the day if user crosses per minute API Rate Limit of 200 hits/min three times in a day OR when max 10k requests/day is reached.

  1. Try adding waits / time.sleep(sec) between requests so that per minute block can be avoided.
  2. May be @communications_team can have some Premium API subscription plan for higher usage limits.

Could you please provide more details? I’m still encountering the same error, and the previous solution didn’t resolve it.

Thank you!