I am interested in a reliable and robust procedure for collecting python package and dependencies for the Psychopy library into a single collection or environment to make a self-contained and maintainable installation. As well it would be good to have some general recommendations on the recommended way to do this since googling Nixos and Python yields a number of approaches, some of which use poorly documented function e.g. myEnvFun
Psychopy is a python package used for psychology experiments. It has several dependencies, most of which are python packages, but not all (e.g. AVbin); and most of which are in the nixos package collection, but not all (pyo and py-parallel).
My goal would be to be able to get all the needed pieces together and have a functioning psychopy environment with a single installation request. I have figured out how to get psychopy installed, but the path's don't play nicely.
For example if the following is saved as ~/pkg/psychopy/default.nix
let
pkgs = import <nixpkgs> {};
in
{stdenv ? pkgs.stdenv, python ? pkgs.python, fetchurl ? pkgs.fetchurl}:
with pkgs;
buildPythonPackage {
name = "psychopy";
src = fetchurl {
url = http://sourceforge.net/projects/psychpy/files/PsychoPy/PsychoPy-1.82.02.zip;
md5 = "52309280bdca4408970aab0952c674e4";
};
buildInputs = [
python27
];
}
One can run nix-env -f ~/pkg/ -iA psychopy
and Psychopy will be installed, but it will not be easily useable because the path to the psychopy library is not seen by any system wide python2 installation, or even the python version that is installed as part of the build inputs.
This leads to the following questions that though they are specifically about psychopy would apply more generally to python and Nixos.
- Is the recommend practice to install python packages that exist in the nixos expression collections (e.g. numpy and scipy) once as system or user wide packages or with each particular experimental library?
- If one wishes to bundle together a python collection with more than one library outside the nixos expression channel (e.g. psychopy and pyo and pyparallel) what is the recommended procedure? And how does this change if some non-python software is required, e.g. in this case AVbin (which actually has installation instructions that refers to paths that are not standard in Nixos to my understanding, i.e. /usr/lib)?
- Can some discussion of handling paths in Python with the context of Nixos be shared?