python-binance icon indicating copy to clipboard operation
python-binance copied to clipboard

Error: OverflowError: Python int too large to convert to C long

Open vkorobeynyk opened this issue 2 years ago • 2 comments

I am trying to place few orders by using the following piece of code:

client$futures_create_order(symbol = coin, side = "BUY", type = "MARKET", positionSide="LONG", quantity = qty)

and I am getting the OverflowError of python int too large to convert to C long.

Some background on my OS/language: I am using windows10 64-bit. I am also using Rstudio/R and importing python-binance via reticulate package. From the error, I think that the problem is with the timestamp that is returned from futures_create_order which is too large to be converted to C long.. In theory, if I would be using python and creating an int that large, I could convert it to int64 but in this situation i dont know how to solve my issue and was hoping for some tips. Not sure if its from reticulate package side or not...

vkorobeynyk avatar Apr 29 '23 21:04 vkorobeynyk

From the error message, it looks like your python interpreter is 32-bit .

halfelf avatar May 04 '23 03:05 halfelf

Initially I also thought that but i am using 64bit...

Reticulate uses python3.10 use_python("/Users/vkorobeynyk/AppData/Local/Programs/Python/Python310/python.exe")

and

>>> sys.maxsize is 9223372036854775807

the only weird thing is that if I use reticulate and import sys within Rstudio and check sys$maxsize, it returns -1

vkorobeynyk avatar May 05 '23 17:05 vkorobeynyk