bean-price issues

169 views
Skip to first unread message

Gary Roach

unread,
Feb 2, 2025, 10:26:27 PM2/2/25
to Beancount
I'm running into an issue with bean-price. I was getting a 401 Unauthorized message when attempting to use the Yahoo price module with    bean-price -e 'USD:yahoo/AAPL'     Similar to this post.

I installed the latest master branch of bean-price with    pip install git+https://github.com/beancount/beanprice.git    but now I'm getting the following error.

File "/usr/local/lib/python3.9/dist-packages/beanprice/price.py", line 678, in <module>
    data.Directives,
AttributeError: module 'beancount.core.data' has no attribute 'Directives'

This looks like a version mismatch, but I'm not sure which branch of bean-price I should install to allow this to work. I'm currently using
  • beancount version 2.3.6
  • bean-price version 1.2.2
Requirements.txt states that bean-price 1.2.2 should work with beancount>=2.3.4. Is there something else I'm missing here? 

Gary Roach

unread,
Feb 3, 2025, 12:10:19 AM2/3/25
to Beancount
Ok. I found the PR that broke it. 
https://github.com/beancount/beanprice/pull/96/files#diff-de242ff59987b1714db86c8be1cd787e963fc89aad8474e060b56ecb02316426

This change added a call to the beancount.core.data.Directives attribute which doesn't exist in beancount v2.3.6. 

fin

unread,
Feb 3, 2025, 12:11:25 AM2/3/25
to bean...@googlegroups.com
Gary Roach wrote:
> ------=_Part_247808_1744915124.1738553186716
> Content-Type: multipart/alternative;
> boundary="----=_Part_247809_622359831.1738553186716"
>
> ------=_Part_247809_622359831.1738553186716
> Content-Type: text/plain; charset="UTF-8"


hi,

looks like someone broke things, go back to commit 4f3e272d834395cd046477c7ba43cbbe855770e3 by martin as that one works.

git checkout 4f3e272d834395cd046477c7ba43cbbe855770e3

fin


> I'm running into an issue with bean-price. I was getting a 401 Unauthorized
> message when attempting to use the Yahoo price module with bean-price -e
> 'USD:yahoo/AAPL' Similar to this post
><https://groups.google.com/g/beancount/c/9XngjLys8CY/m/yRJHLoXlBAAJ>.
>
> I installed the latest master branch of bean-price with pip install
> git+https://github.com/beancount/beanprice.git but now I'm getting the
> following error.
>
> File "/usr/local/lib/python3.9/dist-packages/beanprice/price.py", line 678,
> in <module>
> data.Directives,
> AttributeError: module 'beancount.core.data' has no attribute 'Directives'
>
> This looks like a version mismatch, but I'm not sure which branch of
> bean-price I should install to allow this to work. I'm currently using
>
> - beancount version 2.3.6
> - bean-price version 1.2.2

Gary Roach

unread,
Feb 3, 2025, 12:38:13 AM2/3/25
to Beancount
On Monday, February 3, 2025 at 12:11:25 AM UTC-5 fin wrote:

looks like someone broke things, go back to commit 4f3e272d834395cd046477c7ba43cbbe855770e3 by martin as that one works.

 
Thank you. bean-price is working for me now after installing that version via pip.
pip install git+https://github.com/beancount/beanprice.git@4f3e272d834395cd046477c7ba43cbbe855770e3
Reply all
Reply to author
Forward
0 new messages