Unable to determine resource path

When I install 5.2 from source, and then try to start it by typing ‘gramps’, I see

ResourcePath.ERROR: Unable to determine resource path

Wasn’t that supposed to be fixed?

Which installation scheme did you use? Gramps will look in the usual places.

If your resource path can’t be found, you can provide it by using the RESOURCE_PATH environment variable.

I did a standard install as documented in the INSTALL file. And in previous installations, that meant that I never had to bother about those resources. And I thought that we had a fix for that, written by Jean Michault, but it appears that that PR is still open:

Note that it seems that we still have eggs.

I tried the install in my LMDE 6 partition, which is based on Debian bookworm. Setting the GRAMPS_RESOURCES variable (to the path with the eggs) helped, but led to a locale error that I couldn’t solve.

I encountered the same problem on Kubuntu 23.10.

The standard install is this following:

python3 setup.py build
sudo python3 setup.py install

Is that what you mean?

I just tested it again using --root to install it to test directory. It worked fine for me. I ran it with python -m gramps and it picked up the correct resource path without a problem.

I can see an egg directory, but that isn’t where I ran it from.

Yes, that’s what I mean. I had a standard 5.1 install on that partition on it, and that worked without special provisions.

I tried again after removing the old Gramps first, but that didn’t help either.

And on reading jacrider’s comments, I won’t try the install on my normal Mint yet, because that’s also based on ubuntu.

Did you try starting it with python -m gramps from the package directory as I suggested?

On Arch the installation directories are:

code: usr/lib/python3.11/site-packages/gramps
locale: usr/share/locale
resources: user/share/gramps

Where does your install put things?

I got the interface in French by using LANGUAGE=fr.

Starting using the gramps script was more difficult. I had to set the PYTHONPATH, but it worked.

This PR appears to be about running Gramps from an egg without installing it. I haven’t tested it yet.

I didn’t try the other things, because I think that in the end, the gramps command should just work. That’s what we demand with a .deb package too, once that is released.

What I mean is that I could try all sorts of things, but the install should make sure that I don’t need to, just like it does in previous versions.

My questions are just to help me understand why it works for me but not for you.

Is it python version related? or perhaps distribution related? I don’t know without some debugging information, such as where it installed your files.

I only have to set the PYTHONPATH when I deliberately install to a really weird location, but that is expected. Even then it still finds the resource path automatically.

It is very difficult to debug a problem that I can’t reproduce.

I don’t know what information would help if it is working for you. The output of the build and install commands is too large to include here and I don’t see any errors. But the only files installed on my system are /usr/local/bin/gramps, /usr/local/lib/python3.11/dist-packages/easy-install.pth, and the large directory tree /usr/local/lib/python3.11/dist-packages/gramps-5.2.0-py3.11.egg, so I would guess that extracting the egg is not working correctly.

1 Like

I haven’t been keeping up with developments in Python, and I’ve never worked with egg packages, so I decided to do a little research and discovered that egg files were replaced by wheel files last year. There were messages at the beginning of the install about “setup.py install” and easy_install being deprecated and that pypa/build, pypa/installer, or other standards-based tools should be used. I don’t know if this could be causing the problem as I’m using the latest Kubuntu.

1 Like

The whole thing was discussed earlier, in October 2023, and in that thread, you can also read about the fix that Jean Michault made for it.

And because it was discussed then, and he made a PR, I thought that it would have been fixed in this release.

With some experimentation, I got something that runs. I unzipped the egg file and found three directories, EGG-INFO, gramps, and share. I copied EGG-INFO and gramps to /usr/local/lib/python3.11/dist-packages and share to /usr/local/. However, the first thing I encountered was a failure to load the Narrated Web Site plugin with the error message “name ‘localAlphabeticIndex’ is not defined”. At this point, I’m ready to go back to 5.1.6 until these problems are resolved.

2 Likes

To support Enno’s comments I tried unsuccessfully to install RC1 on my
spare Ubuntu 22 machine and gave up after quite a number of hours with
the same issues as described to the point where I have done a clean
install of Ubuntu Mate and parked things until the .deb has been released.
Phil

I understand that, and the answer lies in a change of the setup script that was made months ago. That was supposed to be a modernization, which is necessary for modern Debian versions, I think, but the install part has a fatal error, that one can only find by running the install and typing gramps, or starting Gramps from the menu.

And since the installer is destructive, in the sense that it overwrites your existing installation, and there is no remove either, it is quite nasty to test, also because most things look normal. When I run it, the locales seem to be there, but they don’t work in LMDE 6, based on Debian bookworm, and they don’t work on ubuntu either, which is based on an older Debian version.

And when this happens, running a 5.1 installer, from source, or from a .deb file, doesn’t work either, so you need timeshift to roll back your whole system. That works here most of the times, but I prefer to avoid that in my production environment, because it can be risky.

We have a thread with a lot of technical details here, started by Jean Michault:

And I hope that we can find ways to test source distributions including build and install on Arch, Debian, Fedora, and ubuntu, before releasing. And I know that that might not always be easy.

Thank you. That is the information that I needed to know.

On Arch Linux, I the code is installed in python/pthon3.11/site-packages/gramps. It is not in an egg. There is another directory called python/pthon3.11/site-packages/gramps-5.2.0-py3.11.egg-info but this only contains metadata.

This also explains why Jean Michault wanted to run it from an egg. I couldn’t understand why someone would want to run an egg, and was thinking of a realistic scenario where I could install an egg and test his PR.

I tested all three supported installation schemes on Arch Linux and they worked fine.

Since I got the same egg as jacrider, it looks like the failure to extract the egg is a common factor between plain Debian (and LMDE 6) and Ubuntu (and regular Mint). And that should be visible in the install log somewhere, but that log is huge.

I could make version 5.2 run because on my system there was a folder named ‘share’ inside the egg folder, and that worked as a resource path. The locale kept failing however.

When I look at wikipedia, it seems that Arch is an independent distribution. Is that right?

And would you agree that we should at least test the install code on the other ones that I mentioned? Debian and Ubuntu are almost one family, and Fedora is another. There are more candidates in the DistroWatch top 10, but we can skip the ones that are based on Debian or Ubuntu.