Gramps does not recognize svgwrite install / Plug in help

(Gramps 5.1.5, Ubuntu 22.04)

This is a follow-up to my earlier post about Add On installation failure.

The LifeLineChartView plug Has the following code snippet:

        mp=ModuleProvider('LifeLineChartView', _uistate)
        if sys.version_info.major==3 and sys.version_info.minor>5:
            svgwrite = mp.request(
                'svgwrite',
                '1.4.3',
                'https://pypi.python.org/packages/source/s/'
                'svgwrite/svgwrite-1.4.3.zip'
            )
        else:
            svgwrite = True
        life_line_chart = mp.request(
            'life_line_chart',
            life_line_chart_version_required_str,
            'https://pypi.python.org/packages/source/l/'
            'life_line_chart/life_line_chart-' +
            life_line_chart_version_required_str + '.tar.gz'
        )

The problem seems to be that the (base) URL that these two requests are being made to (https://pypi.python.org/packages/source/s/) is non-responsive and I am presuming outdated

SO for those of you more versed in Python (basically, all of you), how should I update the add-on so it will work correctly?

The best way is to install the dependency manually. In this case try:

sudo apt-get install python3-svgwrite

There are some new enhancements in v5.2 which will make installation of addon dependencies easier.

1 Like

It may seem that the link is outdated however, if you follow the code from request() to load_addon_file() in LifeLineChartView\lifelinechartview.gpr.py you’ll see that the URL is used to download the module via curl which works just fine. It boils down to something like this which you can test on your computer (ensure that the output path is valid on your system):

curl -L https://pypi.python.org/packages/source/s/svgwrite/svgwrite-1.4.3.zip --output C:\temp\svgwrite-1.4.3.zip

In case what Nick suggested doesn’t resolve your issue, see bug 12655 and linked bugs for discussions and solutions that have worked for other Linux users who have reported issues with LifeLineChartView and it’s pre-requisites.

Hmm. Ya think this might be an issue?

Command 'curl' not found, but can be installed with:
sudo snap install curl  # version 8.1.2, or
sudo apt  install curl  # version 7.81.0-1ubuntu1.10
See 'snap info curl' for additional versions.

Die bug DIE!

The problem is a mismatch in the version number. In the original code, the version number is given as 1.4, but my installed version is 1.4.1. You would think the request method is smart enough to know 1.4.1 > 1.4, but the test is failing. It gets even more confusing because the most recent version of the module is 1.4.3, but that is not what I have installed, despite using the standard command (pip install svgwrite, which should have put in 1.4.3).

In any event, no more errors. Yay!

Of course, I have no idea how to use it – I don’t see “Life Line Chart” anywhere (Family Line, yes)

No for the PostgreSQL integration…

That’s a good discovery. Would you file a feature request to validate dependencies against newer versions of dependencies?

Not sure if this might cause problems…in this case I believe the addon works with all three versions 1.4/1.4.1/1.4.3, but I can see how some addons might depend on a very specific version of a dependency rather than any available version in case there are incompatibilities between versions.

Discovering where to find the tool after installation can be an issue, so I keep the Addons wiki handy. There’s a page for Lifeline charts.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.