Skip to content

Commit 9f2bbcd

Browse files
committed
Nix: Python3 include isntalled pacakges site-packages
1 parent 6622fb4 commit 9f2bbcd

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

runtimes/python3.nix

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ in piston.mkRuntime {
1212
];
1313

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

1821
packages = pkg.pkgs;

0 commit comments

Comments
 (0)