Skip to content

Commit 9f2bbcd

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

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: runtimes/python3.nix

+4-1
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)