Python venv (help for official wiki)

I need Python with Virtual Environments and followed Python - Python virtual environment to do so. However, nix-shell gives me this error:

error:
       … while calling the 'derivationStrict' builtin

         at /builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'pipzone-shell-env'
         whose name attribute is located at /nix/store/d3qda808yhlkqwaffvq34i4ks2c5lmxc-nixos-23.11/nixos/pkgs/stdenv/generic/make-derivation.nix:348:7

       … while evaluating attribute 'shellHook' of derivation 'pipzone-shell-env'

         at /nix/store/d3qda808yhlkqwaffvq34i4ks2c5lmxc-nixos-23.11/nixos/pkgs/build-support/build-fhsenv-bubblewrap/default.nix:231:7:

          230|     env = runCommandLocal "${name}-shell-env" {
          231|       shellHook = bwrapCmd {};
             |       ^
          232|     } ''

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: attribute 'cudatoolkit_11' missing

       at /home/erti/PROJECT_repos/xxx/shell.nix:8:5:

            7|     python39Packages.virtualenv
            8|     cudaPackages.cudatoolkit_11
             |     ^
            9|   ]);

[erti@nixos:~/PROJECT_repos/oxxx]$ nix-shel shell.nix
nix-shel: command not found

[erti@nixos:~/PROJECT_repos/xxx]$ nix-shell shell.nix 
error:
       … while calling the 'derivationStrict' builtin

         at /builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'pipzone-shell-env'
         whose name attribute is located at /nix/store/d3qda808yhlkqwaffvq34i4ks2c5lmxc-nixos-23.11/nixos/pkgs/stdenv/generic/make-derivation.nix:348:7

       … while evaluating attribute 'shellHook' of derivation 'pipzone-shell-env'

         at /nix/store/d3qda808yhlkqwaffvq34i4ks2c5lmxc-nixos-23.11/nixos/pkgs/build-support/build-fhsenv-bubblewrap/default.nix:231:7:

          230|     env = runCommandLocal "${name}-shell-env" {
          231|       shellHook = bwrapCmd {};
             |       ^
          232|     } ''

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: attribute 'cudatoolkit_11' missing

       at /home/erti/PROJECT_repos/xxx/shell.nix:8:5:

            7|     python39Packages.virtualenv
            8|     cudaPackages.cudatoolkit_11
             |     ^
            9|   ]);

My shell.nix is exactly as explained on nixos.wiki (https://nixos.wiki/wiki/Python)

{ pkgs ? import <nixpkgs> {} }:
(pkgs.buildFHSUserEnv {
  name = "pipzone";
  targetPkgs = pkgs: (with pkgs; [
    python39
    python39Packages.pip
    python39Packages.virtualenv
    cudaPackages.cudatoolkit_11
  ]);
  runScript = "bash";
}).env

Can anyone help me? What did i miss?

which OS version?

try:
cudaPackages.cudatoolkit

https://search.nixos.org/packages?channel=23.11&show=cudaPackages.cudatoolkit&from=0&size=50&buckets={"package_attr_set"%3A[]%2C"package_license_set"%3A["CUDA%20Toolkit%20End%20User%20License%20Agreement%20(EULA)"]%2C"package_maintainers_set"%3A[]%2C"package_platforms"%3A[]}&sort=relevance&type=packages&query=cudatoolkit

Thanks so much for your help! I’m on 23.11. I just took the official example, but cudaPackages.cudatoolkit worked (also needed to set export NIXPKGS_ALLOW_UNFREE=1 first)

(btw, i changed the wiki accordingly)