Hi,

I'm using the following Nix expression to install SNAP for use in a
nix-shell.

```
with import <nixpkgs> {};

let dependencies = rec {
  _snap = with python27Packages; buildPythonPackage {
    name = "snap-3.0.2";
    src = fetchurl {
      url =
"https://snap.stanford.edu/snappy/release/snap-3.0.2-3.0-centos6.5-x64-py2.6.tar.gz";;
      sha256 = "07q3pkm0f49c236vv1yb4kzi09h4nldgdax07r7zr0wbvwlzv43w";
    };
  };
};
in with dependencies;

stdenv.mkDerivation rec {
  name = "snap";
  env = buildEnv { name = name; paths = buildInputs; };
  buildInputs = [
    python27
    graphviz
    gnuplot
    _snap
  ];
}
```

Unfortunately, when I try to do `import snap`, Python says:

  File
"/nix/store/qyavbs7cd4fy0y7grigwhnvfyrypa4a6-python2.7-snap-3.0.2/lib/python2.7/site-packages/snap.py",
line 20, in swig_import_helper
    import _snap
ImportError: No module named _snap

I noticed that _snap.so is not under that directory, but it is under an
even deeper directory. I'm guessing this is the problem.

/nix/store/qyavbs7cd4fy0y7grigwhnvfyrypa4a6-python2.7-snap-3.0.2/lib/python2.7/site-packages/nix/store/fmhcxqk5la805i418m861g3g60p4hvm0-python2.7-bootstrapped-pip-9.0.1/lib/python2.7/site-packages

_snap.so also happens to be one of the data_files field in the setup.py
script from the source. What should I change in my Nix expression so
that Python finds _snap.so?

Thanks!


Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to