Python: Difference between revisions
imported>Lionello Added example for alternative packages |
imported>InLaw add mach-nix as option for python environments |
||
| Line 87: | Line 87: | ||
Discussion and consequences of this approach are in PR https://github.com/NixOS/nixpkgs/pull/55265. | Discussion and consequences of this approach are in PR https://github.com/NixOS/nixpkgs/pull/55265. | ||
=== mach-nix === | |||
Install the package <code>nix-env -if https://github.com/DavHau/mach-nix/tarball/3.1.1 -A mach-nix</code> and run | |||
<syntaxhighlight lang="shell"> | |||
mach-nix env ./env -r requirements.txt | |||
# This will generate the python environment into ./env. To activate it, execute: | |||
nix-shell ./env | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="shell"> | |||
let | |||
mach-nix = import (builtins.fetchGit { | |||
url = "https://github.com/DavHau/mach-nix/"; | |||
ref = "refs/tags/3.1.1"; | |||
}) {}; | |||
in | |||
mach-nix.mkPython { | |||
requirements = '' | |||
pillow | |||
numpy | |||
requests | |||
''; | |||
} | |||
</syntaxhighlight> | |||
Please have a look at more [https://github.com/DavHau/mach-nix/blob/master/examples.md examples] | |||
=== conda === | === conda === | ||