Skip to content

Commit

Permalink
Nix: Python3 include isntalled pacakges site-packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Brikaa committed Aug 20, 2022
1 parent 6622fb4 commit 9f2bbcd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion runtimes/python3.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ in piston.mkRuntime {
];

run = ''
PYTHONPATH=$PISTON_PACKAGES_PATH ${pkg}/bin/python3 "$@"
FIRST_PATH="''${PISTON_PACKAGES_PATH%%:*}"
PYTHON_LIB=$(ls $FIRST_PATH/lib | head -n1)
# include /lib/pythonx.x/site-packages after each path
PYTHONPATH="''${PISTON_PACKAGES_PATH//://lib/$PYTHON_LIB/site-packages:}/lib/$PYTHON_LIB/site-packages" ${pkg}/bin/python3 "$@"
'';

packages = pkg.pkgs;
Expand Down

0 comments on commit 9f2bbcd

Please sign in to comment.