# Problem with local install

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.
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.

edited

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'

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 (64.9k 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"

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