Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear how to install this / Poor documentation #33

Open
JaneSmith opened this issue Mar 19, 2021 · 11 comments
Open

Unclear how to install this / Poor documentation #33

JaneSmith opened this issue Mar 19, 2021 · 11 comments

Comments

@JaneSmith
Copy link

Hello.

I'm trying to install this so I can retrieve price history automatically, instead of doing it manually. I use Fava and would prefer something integrated with that, but as far as I can tell beanprice is all there is.

The installation instructions say:

Install using the usual pip incantation.

What is this supposed to mean? I've tried guessing and running pip install beanprice and pip install bean-price, and both of these commands give me the following error output:

ERROR: Could not find a version that satisfies the requirement beanprice (from versions: none)
ERROR: No matching distribution found for beanprice

So now I'm at a loss. There also doesn't seem to be any documentation on how to actually use the script, as the readme just points to the entire Beancount Google Groups forum.

I'd appreciate any help. Thanks.

@xuhcc
Copy link
Collaborator

xuhcc commented Mar 19, 2021

beanprice is not published to PyPI yet (there's an open issue for that #3) but you can install it directly from GitHub:

pip install https://github.com/beancount/beanprice/archive/master.zip

Documentation on how to use the script can be found at https://beancount.github.io/docs/fetching_prices_in_beancount.html

@doriath
Copy link
Contributor

doriath commented Mar 19, 2021

I agree, it also took me a second to figure out how to set it up. I am actually planning to create PR to improve the documentation. I believe the current state is pretty unstable.

What I think should work:

git clone ...
cd beanprice
pip install .

This should work, unless you try to use the --update flag, in which case I think newer version of beancount is needed. What worked for me is:

pip install --upgrade git+https://github.com/beancount/beancount.git@a78dcc2ec2552595a87fcbdb62a4271e1e9b4a58

@elsaluis
Copy link

Hello, first thanks for this code :)
Trying to use the --update flag to get price history but I am having some troubles, hope you can help.

So I did what @doriath mention:
pip install --upgrade git+https://github.com/beancount/beancount.git@a78dcc2ec2552595a87fcbdb62a4271e1e9b4a58

Then call it like this:

bean-price --update mymoney.beancount

Got the following error:

AttributeError: module 'beancount.ops.lifetimes' has no attribute 'trim_intervals'

Any help would be much appreciated, thanks in advance.

@doriath
Copy link
Contributor

doriath commented Mar 20, 2021

Disclaimer: I am still new to the project and python development.

Having said that, I tried it on new ubuntu installation yesterday and it worked for me (note: I used python 3 and pip3 commands in ubuntu). The pip upgrade was exactly to fix this error, so I wonder why it didn't work. Some things I would try:

  1. Run the upgrade command again, and ensure it actually succeeded (it should print that beancount was uninstalled and then that it was installed.
  2. Try to uninstall beancount with pip uninstall beancount and then try installing at specific version.
  3. How did you install beanprice? Did you use pip install . from source, or did you use the xuhcc command (if the second, then maybe my recommendation of upgrading beancount actually breaks the behavior).

@doriath
Copy link
Contributor

doriath commented Mar 20, 2021

I created beancount/beancount#639 to bump beancount to next minor version. This will allow us to update requirements file to depend on 2.3.4, and will make installation easier. It will also allow us to write unit tests for --update (they currently fail in #26 in CI for the same reason your local command fails).

@elsaluis
Copy link

Thanks once again doriah.
However still stuck.
What I did:
1 - Uninstall Beancount
pip uninstall beancount
All good.

2- Install Beancount using:
pip3 install beancount
Got a sucessfull message:

Successfully installed beancount-2.3.3

3 - Run the command:
pip3 install --upgrade git+https://github.com/beancount/beancount.git@a78dcc2ec2552595a87fcbdb62a4271e1e9b4a58
Got a bunch of:

Requirement already satisfied: ....
but no message saying it was uninstalled and then that it was installed.

4 - Tried the command:
`bean-price --update mymoney.beancount'
Get the error:

bean-price: error: unrecognized arguments: --update

So I guess I broke something...

I am running all this in Windows cmd prompt with Python 3.9.2 and pip3 commands
When I do
pip3 list

Got among others:

Package Version


beancount 2.3.3
beanprice 1.0

I guess I will wait for that next minor version :)

Thanks once again!

@doriath
Copy link
Contributor

doriath commented Mar 20, 2021

#35 has been merged. Could you try updating the code and the updating beancount to 2.3.4 version and see if it works?

@elsaluis
Copy link

Thank you!
Version 2.3.4 installed.
Then I installed beanprice and I can now use --update flag to get price history
Great! Thanks a lot!

doriath added a commit to doriath/beanprice that referenced this issue Mar 23, 2021
The goal is to provide minimal information required for new users to
start using the command:
1. an exact command to install the package (I am new to python and I did
   not know how to do this)
1. simple command to fetch one stock, to ensure installation was
   successful
1. information about required `price` metadata in beancount file
1. infomration about --update flag to fetch most recent prices

I also added the command for the type checker that is used by the CI.

Refs beancount#33
@doriath
Copy link
Contributor

doriath commented Mar 23, 2021

@elsaluis - great to hear it is working for you now!

@elsaluis @JaneSmith - I created #38 with small improvements to README to help new users. Could you take a look if you have a second and see if those changes would be useful? What else did you find useful that we could add to the README?

@elsaluis
Copy link

Great doriath! Those notes will be useful for new users for sure.

May be referring that you should have at least version 2.3.4 of beancount installed, you may confirm that running
pip list command.

Thank you for all this, once again!

@doriath
Copy link
Contributor

doriath commented Mar 24, 2021

Thank you @elsaluis for validating the documentation!

I did not include the version on purpose, because I added the constraint in setup.py. I verified that if user has older version installed (e.g. 2.3.3), then installing beanprice will automatically update beancount to 2.3.4.

I think we can close this issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants