How can I build and install gramps and the addons from the source code on Ubuntu Linux 24.04

So far I have always built and installed gramps and the plugins from the source code myself. After upgrading to ubuntu Linux 24.04 this no longer works.

I get the following error message when I try to run gramps:

/usr/local/bin/gramps:4: DeprecationWarning: pkg_resources is deprecated as an API. See Package Discovery and Resource Access using pkg_resources - setuptools 70.0.0.post20240524 documentation
import(‘pkg_resources’).run_script(‘gramps==5.2.2’, ‘gramps’)
ResourcePath.ERROR: Unable to determine resource path

When I try to build the addons I get the following error message:

$ python3 make.py gramps52 init AddonDirectory
ResourcePath.ERROR: Unable to determine resource path

Hi @Ahnung1

Glad you found your way to the forums!

Searching for ResourcePath.ERROR returns a few results which might be helpful, and as a start take a look at this thread: Unable to determine resource path.

And in short that means, on ubuntu 24.04:

sudo python3 setup.py install --root=/

I just tested that on another partition, and it builds a working 5.2.3. Mint and ubuntu, and debian too, don’t have a ‘python’ command, so you must use ‘python3’.

@Nick-Hall can we add this root option to the INSTALL file on GitHub?

I was able to build and install Gramps from the source code on a beta version of Ubuntu Noble. See my post in the Installing Gramps from a command line for details.

The modern way to install Gramps is:

sudo pip3 install .

No, it’s not. It doesn’t work on LMDE 6.

Interesting. My source is the Python packaging user guide:

Nowadays, the recommended method is to use pip directly with a command like this one: python -m pip install .

I understand what you’re saying, and it may indeed be recommended, but right now, it can not be applied to Gramps on all platforms, so it can’t be our modern way yet.

I tested this 3 months ago, see:

It looks like LMDE 6 (an Debian 12 too) is configured to prevent the installation of user made packages:

error: externally-managed-environment
× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.
If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.
If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.
See /usr/share/doc/python3.11/README.venv for more information.
note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

Reading between the lines, this suggests that there is a modernization in the Python installation on Debian 12 that’s designed to protect users against breaking their system.

See also python - pip install -r requirements.txt is failing: "This environment is externally managed" - Stack Overflow

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