Re: building python package

2023-12-19 Thread lipp f
I noticed something strange. I do this: $ PYTHONPATH=lib/ python >>> import ledger >>> j_file = r"/mnt/e/Data/Invest/data/ledger/xx.j" >>> journal = ledger.read_journal(j_file) >>> journal = ledger.read_journal(j_file) Traceback (most recent call last): File "", line 1, in

Re: building python package

2023-12-19 Thread lipp f
I noticed something strange. I do this: $ PYTHONPATH=lib/ python >>> import ledger >>> j_file = r"/mnt/e/Data/Invest/data/ledger/U13342246.j" >>> journal = ledger.read_journal(j_file) >>> journal = ledger.read_journal(j_file) Traceback (most recent call last): File "", line 1, in RuntimeError:

Re: building python package

2023-12-19 Thread lipp f
sure. I also was thinking to document all steps required to install ledger in a conda environment. On Tuesday, December 19, 2023 at 5:16:00 PM UTC-5 Alexis wrote: > Yay! > > Glad to hear that you managed to get it working. > Welcome to the quirky and wonderful world of Ledger Python! :) > >

Re: building python package

2023-12-19 Thread Alexis
Yay! Glad to hear that you managed to get it working. Welcome to the quirky and wonderful world of Ledger Python! :) I've been using Ledger Python for several years time, happy to answer questions and take inspiration for future API development from your experience with it. To answer your

Re: building python package

2023-12-19 Thread lipp f
A big thank you Alexis. It works indeed. After make install I had to add /home/sergiu/miniconda3/envs/ldg-build/lib to ld.so.conf and I can run python ./python/demo.py Welcome to the Ledger.Python demo! Demo completed successfully. Now, if I understand this correctly, the python module is in

Re: building python package

2023-12-19 Thread Alexis
Hi, quite frankly I'm not particularly fond of acprep and prefer to use the tools it wraps. Please find below the commands I use to cleanly build ledger with Python support on macOS with a build environment setup from nix flake and using cmake and make directly: % rm ledger{,.so} % rm -rf

Re: building python package

2023-12-19 Thread lipp f
Giving up. $ ./acprep clean $ ./acprep configure -DUSE_PYTHON=ON -DPython_ROOT_DIR=/home/sergiu/miniconda3/envs/ldg-build/ $ ./acprep make -- -DUSE_PYTHON=ON -DPython_ROOT_DIR=/home/sergiu/miniconda3/envs/ldg-build/ No errors whatsoever. $ ./ledger Ledger 3.3.2-20230330, the command-line

Re: building python package

2023-12-19 Thread Alexis
Hi, > I can run $ ./ledger --version and I'm getting "Ledger 3.3.2-20230330", Posting the complete output of ./ledger --version is helpful as the version info includes a note about Python support: % ledger --version | head -2 Ledger 3.3.2-20230330, the command-line accounting tool with

Re: building python package

2023-12-19 Thread lipp f
Thank you for all the help Alexis. Probably you didn't notice the previous message but the ncurses issue was resolved, and I can do the full build now. The issues are that the built seems to be without python, there is no python module under site-packages and make install puts the files in a

Re: building python package

2023-12-19 Thread Alexis
Hi, some of the things that you might try to resolve this are: 1. Disable use of libedit by appending -DHAVE_EDIT:BOOL=NO to the ./acprep call 2. Define LDFLAGS="-L$PATH_TO_NCURSES_LIBDIR -lncurses" in the environment when running acprep hoping cmake will pick it up properly. 3.

Re: building python package

2023-12-19 Thread lipp f
I am getting close. I had to uninstall two python packages. readline and ncurses. Compiling and linking ends without errors. I can run $ ./ledger --version and I'm getting "Ledger 3.3.2-20230330", which is great, but the python test, fails on "import ledger". $ make test 100% tests passed, 0

Re: building python package

2023-12-19 Thread lipp f
More progress: - first I have to do ./acprep clean with each attempt - before I've seen your last message, i did ./acprep configure --prefix=/usr/local -- -DUSE_PYTHON=ON -DPython_ROOT_DIR=/home/sergiu/miniconda3/envs/ldg-build/ - I also tryed your options - in make, both sets of options compile

Re: building python package

2023-12-19 Thread Alexis
Hi, > Based on your suggestions I made some progress. It finds boost in configure That's great to hear! > but it is not being picked up. Is there an option to add something to make > INCLUDE? There sure is: CMake's FindBoost Module¹ also offers hints with which an installation prefix or the

Re: building python package

2023-12-19 Thread lipp f
Based on your suggestions I made some progress. It finds boost in configure and fails with "fatal error: boost/filesystem/directory.hpp: No such file or directory" in make. The file exists in /home/sergiu/miniconda3/envs/ldg-build/include/boost/filesystem/directory.hpp but it is not being