Skip to content

Instantly share code, notes, and snippets.

@aswan89
Last active April 28, 2019 17:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aswan89/aaed766b0723a32b956f408e6b7426c0 to your computer and use it in GitHub Desktop.
Save aswan89/aaed766b0723a32b956f408e6b7426c0 to your computer and use it in GitHub Desktop.
reticulate segfault and accompanying detective work
> library(reticulate)
> py_config()
*** caught segfault ***
address 0x8, cause 'memory not mapped'
Traceback:
1: py_run_string_impl(paste0("import sys; sys.path.append('", system.file("python", package = "reticulate"), "')"))
2: initialize_python(required_module, use_environment)
3: ensure_python_initialized()
4: py_config()
> Sys.which('python')
python
"/nix/store/m2br92794yw09hjwh3vzadbphckagmzv-python3-3.7.3-env/bin/python"
> system.file("python", package="reticulate")
[1] "/nix/store/v64aywkbbr4qj92xv19fxmhdv66icl3q-r-reticulate-1.10/library/reticulate/python"
{ config, pkgs, ...}:
with pkgs;
let myPackages =
with rPackages;
[
reticulate
keras
tensorflow
];
in
let
myR = rWrapper.override
{
packages = myPackages;
};
in {
environment.systemPackages = [ myR ];
}
with import <nixpkgs> {};
(python3.withPackages (ps:
[
ps.Keras
ps.tensorflow
]
)
).env
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment