Unable to determine resource path

I just created an egg using:

python setup.py bdist_egg

The egg contains three directories, but the locale sub-directory and possibly other files are missing. We have never supported eggs and I don’t expect it to work.

I suspect that the problem is related to the version of build being used. Some systems will import it from setuptools and others from distutils. See line 37 in our setup.py script. Which one is installed on your system?

This seems to be a known issue. Read the stackoverflow question stopping setup.py from installing as egg.

I have setuptools and distutils, so the script will choose build from setuptools. And in fact it forces me to install setuptools, because there is an import without a fallback on line 35.

Hacking setup.py to use build from distutils does not work here, and the remedies shown on StackOverflow don´t work here, yet.

What happens if you install with the --skip-build option?

Run a build first and make sure that there is no egg in the dists directory.

No change. It still creates an egg, even when I remove the dist directory before install.

I think that using the --root option works. Try:

sudo python setup.py install --root=/

If this works, then our packagers won’t have any problems.

1 Like

It works for LMDE 6, meaning that the resource problems are gone, and the locale is OK.

Will test on Mint 21.3 later.

Is there anyone that can test this on Fedora? I know that @emyoulation has that, but others may have more experience at system level.

1 Like

Yeah. I’m out of my depth here. (And intend to re‐re-format the drive after 5.2 settles down. The test system rejects the admin PW … that I possibly mis-remember. So no sussudio work for me.)

It works on Linux Mint 21.3 too.

2 Likes

I put Fedora 39 on my laptop, and installed the packages mentioned on

https://gramps-project.org/wiki/index.php?title=Running_a_development_version_of_Gramps#Gramps_4.0_and_the_master_branch

Of those, rcs can probably be omitted, but I was too lazy to leave that out. I just pasted the whole yum line in terminal, and put sudo before it.

I then ran the build as described and the install with the ‘–root=/’ option. And the results are the same as on LMDE 6 and Mint 21.3, meaning that I can start Gramps from the command line and the menu, and see that it speaks Dutch to me.

1 Like

Thanks for testing. It looks like the setuptools version installs an egg by default. The --root=/ option is a suitable workaround to force a standard installation.

This needs documenting in the INSTALL file. We can also remove the old --resourcepath section which is no longer required.

H’m, right, no sudo for you then. Anyway, I did the testing work for you, so that you can install 5.2 from source if you follow the instructions from the Gramps wiki and add the ‘–root=/’ option to the install command.

1 Like

Could it be that this egg issue with setuptools also affects the creation of flatpaks? There is another thread where a flatpak user complains about a missing locale, and that’s very much the same effect as running the old install and then specifying GRAMPS_RESOURCES on the command line.

And as far as I’m concerned, eggs don’'t work well with flat packs anyway, unless you want an omelet.

The latest Flatpaks are built using pip install which installs from a wheel.

We should probably recommend:

sudo pip3 install .

This works for me. Are you able to test on Ubuntu and Fedora for us?

Done. It works nice on Fedora and Mint 21.3, which is based on Ubuntu. And on the latter, it even gives me a chance to go back to Gramps 5.1.7 (my personal hack).

No luck on LMDE 6 though, based on Debian 12 a.k.a. bookworm.

2 Likes

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