building ledger on arch linux: python version

104 views
Skip to first unread message

Gina White

unread,
Nov 12, 2016, 12:48:33 PM11/12/16
to ledge...@googlegroups.com
After finding it quite easy to build ledger on the mac, I'm running into trouble building it on arch linux (which is what my main development machine runs). 

The first problem is that the python scripts seem to assume python2 but when '/usr/bin/env python' is run on my arch linux machine, that uses python3.

Are there thoughts about python versions for the scripts?  The workaround being used in the community package for arch linux ledger is to change the ledger source to run '/usr/bin/env python2'.  You can see that in the prepare function here: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=ledger-git.

One approach would be to make the scripts python3-compatible.  I'm not sure what downsides that might include though.

Another approach would be to change all the ledger scripts to specify '/usr/bin/env python2'.  I'm not sure if that would work well though in the other places where ledger is being built.

thanks
- Gina

Jacob MacDonald

unread,
Nov 12, 2016, 4:05:10 PM11/12/16
to ledge...@googlegroups.com

The solution I'm seeing online is to update the python symlink to point at python2 instead of 3. On Gentoo you could use eselect, not sure if Arch has an equivalent.

Best,

Jacob.


--

---
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 ledger-cli+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yuval Hager

unread,
Nov 13, 2016, 9:58:08 AM11/13/16
to ledge...@googlegroups.com
This means changing the default python version in the system. Since Arch is
using python3 by default (has been for quite a while now), it might break the
system in unexpected ways.

Markus Teufelberger

unread,
Nov 13, 2016, 5:59:43 PM11/13/16
to ledge...@googlegroups.com
Specifying "python2" is definitely the safest way with 0 downsides known to me and it seems like a relatively harmless and trivial fix.
Reply all
Reply to author
Forward
0 new messages