Open aswan89 opened 5 years ago
Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:
This is important to my use case.
I marked this as stale due to inactivity. → More info
For a shell I don't think you need the wrappers:
mkShell {
propagatedBuildInputs = [
R
rPackages.reticulate
rPackages.keras
python3
python3Packages.keras
python3Packages.tensorflow
];
}
Issue description
When troubleshooting an issue (rstudio/reticulate#487 ) with the R package reticulate (designed to allow the use of python packages within R) it was discovered that the issue was related to reticulate relying on PYTHONPATH for finding the python packages of interest.
This was eventually solved with a call to mkShell and shellHooks to manually set PYTHONPATH but this seems like a counter-intuitive/hacky way to make python packages available to other software within a given environment.
I'm far from a competent python developer and I don't have a good understanding of what goes on to wrap python for use within Nix so it may be that there is an existing, less manual method for making python packages available to other software.
Steps to reproduce
Current documentation suggests a number of ways to make python package available for development purposes but given that this application required both R and Python a shell.nix file seemed to be the best option. Using this as a shell.nix file:
echo $PYTHONPATH
does not return a value, nor doesos.environ['PYTHONPATH']
from within the python REPL.Attempting to use reticulate functions within the generated environment causes a segfault, though I think that has more to do with their error handling.
Changing the shell.nix file as follows remedies the problem:
Technical details
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the results."x86_64-linux"
Linux 4.19.36, NixOS, 19.03.172500.aade6ded796 (Koi)
yes
no
nix-env (Nix) 2.2.2
"nixos-19.03.172500.aade6ded796"
"nixos-18.09beta11.c0bde692f6c"
/nix/var/nix/profiles/per-user/root/channels/nixos