Can't install S3 Media Uploader add-on

When I try to install the S3 Media Uploader, I can see that it needs boto3, which it seems to install, but during the install process, I get an exception:

543527: ERROR: grampsapp.py: line 188: Unhandled exception
Traceback (most recent call last):
File “C:\Program Files\GrampsAIO64-5.2.0\gramps\gui\plug_windows.py”, line 312, in __on_install_clicked
spec.loader.exec_module(module)
File “”, line 944, in exec_module
File “”, line 241, in call_with_frames_removed
File "C:\Users\ennob\AppData\Local\gramps\gramps52\plugins\lib\boto3_init
.py", line 16, in
from boto3.compat import _warn_deprecated_python
File “C:\Users\ennob\AppData\Local\gramps\gramps52\plugins\lib\boto3\compat.py”, line 19, in
from boto3.exceptions import PythonDeprecationWarning
File “C:\Users\ennob\AppData\Local\gramps\gramps52\plugins\lib\boto3\exceptions.py”, line 15, in
import botocore.exceptions
ModuleNotFoundError: No module named ‘botocore’

I haven’t look for this thing on the web yet, and haven’t tried this on Linux either. I’m using my own AIO installer, which I build from our maintenance/gramps52 branch.

Confirmed on this bug report 0013022: Addon Requirements code is still not quite right. - Gramps - Bugtracker – Free Genealogy Software

Fixed in commit 3c59051.

I saw the new list of required modules, but it looks like botocore needs another one:

303543: ERROR: grampsapp.py: line 188: Unhandled exception
Traceback (most recent call last):
File “C:\Program Files\GrampsAIO64-5.2.0\gramps\gui\plug_windows.py”, line 312, in __on_install_clicked
spec.loader.exec_module(module)
File “”, line 944, in exec_module
File “”, line 241, in call_with_frames_removed
File "C:\Users\ennob\AppData\Local\gramps\gramps52\plugins\lib\s3transfer_init
.py", line 137, in
from botocore.compat import six # noqa: F401
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\ennob\AppData\Local\gramps\gramps52\plugins\lib\botocore\compat.py”, line 31, in
from dateutil.tz import tzlocal
ModuleNotFoundError: No module named ‘dateutil’

I’ve added a couple more dependencies in 5595c56.

And that gave me a new error:

339842: ERROR: grampsapp.py: line 188: Unhandled exception
Traceback (most recent call last):
  File "C:\Program Files\GrampsAIO64-5.2.0\gramps\gui\plug\_windows.py", line 312, in __on_install_clicked
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap_external>", line 1077, in get_code
  File "<frozen importlib._bootstrap_external>", line 1134, in get_data
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\ennob\\AppData\\Local\\gramps\\gramps52\\plugins\\lib\\python-dateutil\\__init__.py'

Have you any idea what is going wrong? I can’t reproduce this on Linux.

Was python-dateutil installed?

Does it work after restarting Gramps?

Yes, I have. It seems that dateutil is installed in the dateutil folder, and the code expects to find it in python-dateutil.

In the attached screenshot, you can see that the folder names are not very consistent. For the life_line_chart and svgwwrite, they are the same as the accompanying dist-info folders before the dash. And that is not the case for the dateutil folder, and the six.py file, which does not have its own folder.

This inconistency is not a real problem however, because each dist-info folder has a RECORD file, without extension, that lists the exact locations (paths) of the installed files. And all installed files have the exact names and locations as they appear in that RECORD file. I checked that for dateutil and six.

When I look at the code, it suggests that it is based on an assumption about module names that is not right, but that’s just a quick conclusion, so I may be wrong.

I’m testing with W10 pro running on my laptop, and W10 running in VirtualBox on my desktop, inside LMDE 5 (Linux Mint Debian Edition). The screenshot is from the VM.

P.S. I corrected an earlier message, because part of the text was interpreted as markdown. And I had to be careful with this one too, because backslashes disappear outside a code block.

I just cloned your repo, for another reason, and it goes wrong on Linux here too.

A call to importlib.invalidate_caches after the pip install seems to solve the problem.

This solution also has the benefit that it is no longer necessary to list all the dependencies in the gpr file.

Please test again.

Thanks! It works great in Windows, but I still got an exception in LMDE 5, caused by the S3 loader trying to import boto3.

I checked the plugins/lib folder there, and found similar contents as in Windows, including boto3, so it seemed to be there.

Trying import boto3 in python3 raised an exception too, so I tried “pip install boto3” in bash, and tried again, and saw everything work.

This suggests that when I run Gramps from source in Linux, the plugins/lib folder is not in the Python path, so that the boto3 module sitting there is not found. Installing it in the regular way cures that.

This is just a quick guess, made after midnight.

The LIB_PATH is defined and appended to sys.path in the const.py file.

I considered using getusersitepackages() in the site package to provide a better location e.g. ~/.local/lib/python3.11/site-packages on Linux. This would change if a different version of python was used, but would probably be acceptable.