Welcome to Cadabra Q&A, where you can ask questions and receive answers from other members of the community.
0 votes

I configured with CMAKE_INSTALL_PREFIX=/home/user/.local, but make install fails with the following error message:

Install the project...
-- Install configuration: ""
CMake Error at core/cmake_install.cmake:44 (file):
file cannot create directory: /usr/local/lib/python3.5/dist-packages.
Maybe need administrative privileges.
Call Stack (most recent call first):
  cmake_install.cmake:37 (include)

Makefile:83: die Regel für Ziel „install“ scheiterte
make: *** [install] Fehler 1

Make install/local succeeds, but does not install the cadabra2-gtk executable.

in Installation trouble by (340 points)
edited by

A local install with

DESTDIR=/home/user/.local/ make install

and empty CMAKE_INSTALL_PREFIX works if I set the PYTHONPATH and LD_LIBRARY_PATH correspondingly. But then executing cadabra2-gtk aborts with the following error mesage:

cadabra-client: spawning server terminate called after throwing an instance of 'Glib::SpawnError'

1 Answer

0 votes

This is due to my lack of knowledge of how to install Python packages if you do not go through pip or other package managers. At the moment, Cadabra runs the following Python script to determine where to install the cadabra module:

import site
print( site.getsitepackages()[0] )

which will produce

/usr/local/lib/python3.5/dist-packages

or something similar under /usr/local on most systems. No idea how to do this 'properly' (if such a thing even exists; Python simply ignoring existing package managers is the source of endless trouble...). If you know more about this, I am all ears.

by (82.5k points)

I would say you have two options:

(1) Determine the installation path for Python modules in case of a local installation by

import site
print( site.getusersitepackages() )  # note the "user"

instead.

(2) Prepend the global installation path with the local one in CMAKE_INSTALL_PREFIX.

I would prefer (1), since this is the common place for local python modules and known to your Python by definition. But (2) could be used as a fallback.

...