[GNC-dev] Testing python

Andy Goblins andygoblins at gmx.com
Sun Apr 19 10:18:09 EDT 2020


   Since my python virtual environment is installed in the base of my
   build directory, I assume it naturally has access to build/lib/gnucash
   and build/lib/python3.8/site-packages. This appears to be working
   partially; it picks up the altered gnucash library in
   build/lib/python3.8 but it isn't getting the C libraries in
   build/lib/gnucash.

   I also tried skipping the virtual environment and just running
   "GNC_UNINSTALLED=1;GNC_BUILDDIR=<my build
   dir>;PYTHONPATH=$GNC_BUILDDIR/lib/python3.8/site-packages:$GNC_BUILDDIR
   /lib/gnucash python" just like the cmake tests use, but I get the same
   result; it's not finding the libgncmod-backend stuff in
   build/lib/gnucash.

   Sent: Saturday, April 18, 2020 at 12:47 PM
   From: "Mark" <epistemik at gmail.com>
   To: "andygoblins" <andygoblins at gmx.com>
   Cc: "GnuCash Developer" <gnucash-devel at gnucash.org>
   Subject: Re: [GNC-dev] Testing python
   I use the python bindings regularly but I've never got any warnings or
   errors such as you describe. Just to cover the basics first, are you
   sure you didn't want to issue the venv command with the
   '--system-site-packages' switch? Did you have pygnucash loaded to the
   pip of the python you used for venv? Or instead did you make sure that
   in your venv you have included the path to your tinkered bindings in
   your PYTHONPATH? And you activated the venv before using? Sorry if this
   is all basic stuff you already know about.



   Mark
   [1]epistemik at gmail.com
   (613) 447-5385



   On Sat, Apr 18, 2020 at 10:08 AM andygoblins <[2]andygoblins at gmx.com>
   wrote:

        I'm tinkering with the python bindings, but I'm having trouble
     testing
        the results of my changes. Could anyone give me some advice?
        Currently, I build gnucash with ninja and then run 'python -m
     venv
        <build dir>' to set up a virtual python environment right next to
     the
        fresh build. But when I try to import gnucash in the virtual
        environment, it doesn't load any of the backends:
        WARN <gnc.engine> failed to load gncmod-backend-dbi from relative
     path
        ERROR <gnc.engine> required library gncmod-backend-dbi not found.
        WARN <gnc.engine> failed to load gncmod-backend-xml from relative
     path
        ERROR <gnc.engine> required library gncmod-backend-xml not found.
        Any ideas on how to fix my path so I can load backends in my test
        environment?
     _______________________________________________
     gnucash-devel mailing list
     [3]gnucash-devel at gnucash.org
     [4]https://lists.gnucash.org/mailman/listinfo/gnucash-devel

References

   1. mailto:epistemik at gmail.com
   2. mailto:andygoblins at gmx.com
   3. mailto:gnucash-devel at gnucash.org
   4. https://lists.gnucash.org/mailman/listinfo/gnucash-devel


More information about the gnucash-devel mailing list