examples icon indicating copy to clipboard operation
examples copied to clipboard

OverflowError: Python int too large to convert to C long

Open ymanol opened this issue 5 years ago • 3 comments

I ran the 2sectors example and received the following error:

File "abcEconomics\trade.pyx", line 485, in abcEconomics.trade.Trade.sell File "abcEconomics\trade.pyx", line 121, in abcEconomics.trade.Offer.cinit OverflowError: Python int too large to convert to C long

ymanol avatar Dec 16 '19 08:12 ymanol

Same error here I experience:

File "abcEconomics\trade.pyx", line 485, in abcEconomics.trade.Trade.sell File "abcEconomics\trade.pyx", line 121, in abcEconomics.trade.Offer.cinit OverflowError: Python int too large to convert to C long

Any way to fix it?

patrickxli avatar Mar 19 '20 18:03 patrickxli

Didn't see this issue until just now. The abcEconomics on current master (not yet renamed to main to avoid the bad connotation) no longer uses cython, because the speedup gain is not significant, so we remove it for simplicity's sake. I will try to update the version uses in this repo when I have the time.

Currently, to make it work on cython's C, we probably need to use long long (int64).

rht avatar Jul 14 '20 05:07 rht

I ran the start.py of 2sectors on latest master (https://github.com/AB-CE/abce/commit/983d427899a081160a3e3f0592ed0b1c1e3b69ab) and it worked fine. However, some of the examples are using outdated API that it will take a while to update this repo's requirements.txt.

rht avatar Jul 14 '20 06:07 rht