Hi

from the information presented I have no clear understanding of the
environment and setup and I'm unfamiliar with conda and its specialities.

It seems to me as if some environment manager (miniconda?) is
setting up the environment so its Python (version 3.9) is preferred.
Is there a way, where you could have a shell that only uses the system
Python and retry building ledger with Python support?

Unfortunately I have no good advice for troubleshooting CMake
apart from reading FindPython.cmake¹ :/

What I suggest is giving CMake a hint about which Python you'd prefer to
be used (see Python_ROOT_DIR in FindPython module documentation²).

If I'm not mistaken on Ubuntu the Python root installation directory
should be /usr as the python executable resides in /usr/bin/python
and its libraries in /usr/lib/python3.8; at least according the
file Ubunut filelist³

How about trying the following:
  % rm -rf ./build
  % ./acprep configure --python -- -DPython_ROOT_DIR=/usr
  % ./acprep make
  % /usr/bin/env PYTHONPATH=$PWD/build/ledger/debug python3 -c 'import ledger; 
dir(ledger)'

or if your prefer to avoid using acprep:
  % rm -rf ./build
  % cmake --fresh -Bbuild -S. -DUSE_PYTHON:BOOL=ON -DPython_ROOT_DIR=/usr
  % make -j8 -Cbuild
  % /usr/bin/env PYTHONPATH=$PWD/build python3 -c 'import ledger; dir(ledger)'


Hope this helps!
If it's not too much to ask I'd appreciate to hear back if you run
into issues and if you succeed I'd be interested in what you think
would have helped you and made building Ledger Python easier for you.


Best
Alexis

¹ https://github.com/Kitware/CMake/blob/master/Modules/FindPython.cmake
² https://cmake.org/cmake/help/latest/module/FindPython.html#hints
³ https://packages.ubuntu.com/focal/amd64/libpython3.8-minimal/filelist

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/4hyhauhsdy76vtegnzzildstw5hc5gdugmeurrsvi2cwbwiufd%40yqsgq7nl4ox6.

Reply via email to