From a0b982e67cd28b906721d6bfc998599eb627e5fe Mon Sep 17 00:00:00 2001 From: racoot <63659772+sukhmancs@users.noreply.github.com> Date: Sun, 20 Oct 2024 16:51:27 -0400 Subject: [PATCH] added some tweaks --- flake-parts/templates/python/flake.nix | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/flake-parts/templates/python/flake.nix b/flake-parts/templates/python/flake.nix index 9dd6eb6..fd3e59a 100755 --- a/flake-parts/templates/python/flake.nix +++ b/flake-parts/templates/python/flake.nix @@ -23,10 +23,19 @@ default = pkgs.mkShell { venvDir = ".venv"; packages = with pkgs; - [python3] + [ + python310 + (pkgs.python310.withPackages (ps: [ + ps.pip + ps.tkinter + ])) + ] # These packages that are packaged with nixpkgs. You can also install packages using pip. - ++ (with pkgs.python3Packages; [ - pip + # For some reason, if I include pip in this list of packages, the packages installed with pip are not available in the shell environment. + # Instead u get an Error: No module named 'your_module'. It works fine if using pkgs.python3.withPackages (i.e the latest python version). + # For me, I usually need to deal with older python versions, most of the time tenorflow, pytorch, relies on some older packages like distutils + # which are removed from python 3.12+. + ++ (with pkgs.python310Packages; [ venvShellHook ipython ipykernel # required for jupyter notebooks