Python: Difference between revisions

imported>Mic92
No edit summary
imported>Mic92
No edit summary
Line 1: Line 1:
== Installation ==
== System-wide installation ==


The Python packages available to the interpreter must be declared when installing Python.
The Python packages available to the interpreter must be declared when installing Python.
Line 6: Line 6:


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
environment.systemPackages =
environment.systemPackages = let
let myPythonPackages = pythonPackages: with pythonPackages; [
  myPythonPackages = pythonPackages: with pythonPackages; [
  pandas
    pandas
  requests
    requests
  # other python packages you want
    # other python packages you want
];
  ];  
in
in with pkgs; [
with pkgs; [
   (python3.withPackages myPythonPackages)
   (python3.withPackages myPythonPackages)
   # all your other (non-Python) packages
   # all your other (non-Python) packages