J'essaie de comprendre comment fonctionne nix. Pour cela, j'ai essayé de créer un environnement simple pour exécuter des ordinateurs portables jupyter.Comment lancer un `nix-shell` avec un fichier default.nix?
Quand je lance la commande:
nix-shell -p "\
with import <nixpkgs> {};\
python35.withPackages (ps: [\
ps.numpy\
ps.toolz\
ps.jupyter\
])\
"
-je obtenir ce que je pensais - une coquille dans un environnement avec python et les tous les paquets installés répertoriés, et les toutes les commandes attendues accessibles sur le chemin:
[nix-shell:~/dev/hurricanes]$ which python
/nix/store/5scsbf8z3jnz8ardch86mhr8xcyc8jr2-python3-3.5.3-env/bin/python
[nix-shell:~/dev/hurricanes]$ which jupyter
/nix/store/5scsbf8z3jnz8ardch86mhr8xcyc8jr2-python3-3.5.3-env/bin/jupyter
[nix-shell:~/dev/hurricanes]$ jupyter notebook
[I 22:12:26.191 NotebookApp] Serving notebooks from local directory: /home/calsaverini/dev/hurricanes
[I 22:12:26.191 NotebookApp] 0 active kernels
[I 22:12:26.191 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/?token=7424791f6788af34f4c2616490b84f0d18353a4d4e60b2b5
Alors, j'ai créé un nouveau dossier avec un seul fichier default.nix
avec le contenu suivant:
with import <nixpkgs> {};
python35.withPackages (ps: [
ps.numpy
ps.toolz
ps.jupyter
])
Quand je lance nix-shell
dans ce dossier cependant, il semble que tout est installé, mais les PATH
s ne sont pas définies:
[nix-shell:~/dev/hurricanes]$ which python
/usr/bin/python
[nix-shell:~/dev/hurricanes]$ which jupyter
[nix-shell:~/dev/hurricanes]$ jupyter
The program 'jupyter' is currently not installed. You can install it by typing:
sudo apt install jupyter-core
Par ce que je read here j'attendais les deux situations équivalentes. Qu'ai-je fait de mal?
Merci pour la clarification. En effet, c'était la section qui m'a conduit à croire errouneously que j'avais la configuration correcte. Merci. –