nix-env -iA nixpkgs.python311它起作用了
但是当我做一个
nix-shell -p nixpkgs.python311或者是一个
nix-shell -p python3-3.11.1很明显,这个名字和arg有问题。
nix-shell -p python3 3-3.11.1错误:字符串处未定义的变量'python3-3‘:1:107:1{.}@args:具有导入 args;(pkgs.runCommandCC或pkgs.runCommand) "shell“{ buildInputs = (python3-3.11.1);}“\x{e76f}”(使用‘-显示-跟踪’来显示详细的位置信息)
问候
发布于 2023-03-15 14:52:30
如果要将任意Nix表达式传递给nix-shell -p,请将其放在括号中:
nix-shell -p '((import <nixpkgs> {}).python311)'任何可以附加到nix-env -iA nixpkgs.中的内容,您都应该能够附加到上面的python311中。它还可以用于以下情况:
nix-shell -p \
'((import <nixpkgs> {}).python311.withPackages (p: [p.lxml p.pyyaml]))'...to提供了安装了lxml和PyYAML的Python3.11。
https://unix.stackexchange.com/questions/739906
复制相似问题