# Can't install S3 Media Uploader add-on

**URL:** <https://gramps.discourse.group/t/cant-install-s3-media-uploader-add-on/4144>\
**Category:** Beta Testing\
**Created:** [September 9, 2023, 2:12pm UTC](https://gramps.discourse.group/t/cant-install-s3-media-uploader-add-on/4144 "2023-09-09T14:12:18Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![ennoborg](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/ennoborg/32/4659_2.png) [@ennoborg](https://gramps.discourse.group/u/ennoborg)\
**Post date:** [September 9, 2023, 2:12pm UTC](https://gramps.discourse.group/t/cant-install-s3-media-uploader-add-on/4144/1 "2023-09-09T14:12:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![anon9092048](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@anon9092048](https://gramps.discourse.group/u/anon9092048)\
**Post date:** [September 9, 2023, 3:04pm UTC](https://gramps.discourse.group/t/cant-install-s3-media-uploader-add-on/4144/2 "2023-09-09T15:04:51Z")

</div>

Confirmed on this bug report [0013022: Addon Requirements code is still not quite right. - Gramps - Bugtracker – Free Genealogy Software](https://gramps-project.org/bugs/view.php?id=13022)

---

<div class="post-metadata">

**Author:** ![Nick-Hall](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/nick-hall/32/95_2.png) [@Nick-Hall](https://gramps.discourse.group/u/Nick-Hall)\
**Post date:** [September 9, 2023, 4:58pm UTC](https://gramps.discourse.group/t/cant-install-s3-media-uploader-add-on/4144/3 "2023-09-09T16:58:51Z")

</div>

Fixed in commit [3c59051](https://github.com/gramps-project/addons-source/commit/3c5905183348924f61d6066b1b4313a932ef39a5).

---

<div class="post-metadata">

**Author:** ![ennoborg](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/ennoborg/32/4659_2.png) [@ennoborg](https://gramps.discourse.group/u/ennoborg)\
**Post date:** [September 9, 2023, 7:01pm UTC](https://gramps.discourse.group/t/cant-install-s3-media-uploader-add-on/4144/4 "2023-09-09T19:01:03Z")

</div>

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’

---

<div class="post-metadata">

**Author:** ![Nick-Hall](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/nick-hall/32/95_2.png) [@Nick-Hall](https://gramps.discourse.group/u/Nick-Hall)\
**Post date:** [September 9, 2023, 8:08pm UTC](https://gramps.discourse.group/t/cant-install-s3-media-uploader-add-on/4144/5 "2023-09-09T20:08:46Z")

</div>

I’ve added a couple more dependencies in [5595c56](https://github.com/gramps-project/addons-source/commit/5595c56b57c06defc86eaf0a4db354eb1db48672).

---

<div class="post-metadata">

**Author:** ![ennoborg](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/ennoborg/32/4659_2.png) [@ennoborg](https://gramps.discourse.group/u/ennoborg)\
**Post date:** [September 10, 2023, 11:59am UTC](https://gramps.discourse.group/t/cant-install-s3-media-uploader-add-on/4144/6 "2023-09-10T11:59:03Z")

</div>

And that gave me a new error:

```python
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'

```

---

<div class="post-metadata">

**Author:** ![Nick-Hall](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/nick-hall/32/95_2.png) [@Nick-Hall](https://gramps.discourse.group/u/Nick-Hall)\
**Post date:** [September 10, 2023, 1:10pm UTC](https://gramps.discourse.group/t/cant-install-s3-media-uploader-add-on/4144/7 "2023-09-10T13:10:42Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ennoborg](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/ennoborg/32/4659_2.png) [@ennoborg](https://gramps.discourse.group/u/ennoborg)\
**Post date:** [September 10, 2023, 1:59pm UTC](https://gramps.discourse.group/t/cant-install-s3-media-uploader-add-on/4144/8 "2023-09-10T13:59:30Z")

</div>

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

 ![Schermafdruk van 2023-09-10 15-27-46](https://global.discourse-cdn.com/free1/uploads/gramps/original/2X/b/b525441b234bdea1b0c5c37f64fd3cda089fbaf9.png)

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.

---

<div class="post-metadata">

**Author:** ![ennoborg](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/ennoborg/32/4659_2.png) [@ennoborg](https://gramps.discourse.group/u/ennoborg)\
**Post date:** [September 10, 2023, 3:28pm UTC](https://gramps.discourse.group/t/cant-install-s3-media-uploader-add-on/4144/9 "2023-09-10T15:28:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Nick-Hall](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/nick-hall/32/95_2.png) [@Nick-Hall](https://gramps.discourse.group/u/Nick-Hall)\
**Post date:** [September 10, 2023, 9:02pm UTC](https://gramps.discourse.group/t/cant-install-s3-media-uploader-add-on/4144/10 "2023-09-10T21:02:42Z")

</div>

A call to [`importlib.invalidate_caches`](https://docs.python.org/3/library/importlib.html#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.

---

<div class="post-metadata">

**Author:** ![ennoborg](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/ennoborg/32/4659_2.png) [@ennoborg](https://gramps.discourse.group/u/ennoborg)\
**Post date:** [September 10, 2023, 10:10pm UTC](https://gramps.discourse.group/t/cant-install-s3-media-uploader-add-on/4144/11 "2023-09-10T22:10:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Nick-Hall](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/nick-hall/32/95_2.png) [@Nick-Hall](https://gramps.discourse.group/u/Nick-Hall)\
**Post date:** [September 11, 2023, 1:18pm UTC](https://gramps.discourse.group/t/cant-install-s3-media-uploader-add-on/4144/12 "2023-09-11T13:18:50Z")

</div>

The `LIB_PATH` is defined and appended to `sys.path` in the [const.py](https://github.com/gramps-project/gramps/blob/maintenance/gramps52/gramps/gen/const.py#L160) file.

I considered using [`getusersitepackages()`](https://docs.python.org/3/library/site.html#site.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.
