I'm trying to install findiff
Python package in NixOS follow this guide.
My pkgs/development/python-modules/findiff/default.nix
file is:
{ lib
, buildPythonPackage
, fetchPypi
, pytestCheckHook
, pytest-runner
, numpy
, scipy
, sympy
}:
buildPythonPackage rec {
pname = "findiff";
version = "0.9.2";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-IWqQhGv+8d3mYdnwJh1byj0su2c0K5fpMTylsvR4c2U=";
};
checkInputs = [
pytestCheckHook
pytest-runner
];
propagatedBuildInputs = [
numpy
scipy
sympy
];
meta = with lib; {
description = "A Python package for finite difference derivatives in any number of dimensions";
homepage = "https://github.com/maroba/findiff";
license = licenses.mit;
maintainers = with maintainers; [ "f0ma" ];
};
}
Package was built successfully as /nix/store/cx78cip77nyb0fiwbqk2v2ddl2jvqc8v-python3.9-findiff-0.9.2
with nix-build -A python39Packages.findiff
.
Command nix-env -f . -iA python39Packages.findiff
shows: installing 'python3.9-findiff-0.9.2'
But I have no idea how to make this package available for python (per-profile, per-user or system-wide) properly (nix-env
?, nix-shell
?):
>>> import findiff
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'findiff'
Only this dirty way works:
>>> import sys
>>> sys.path.append("/nix/store/cx78cip77nyb0fiwbqk2v2ddl2jvqc8v-python3.9-findiff-0.9.2/lib/python3.9/site-packages")
>>> import findiff