Trouble running CUDA

So as the title suggest I’m having trouble running cuda, this is the output I get when i run nvcc --version

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Tue_Mar__8_18:36:24_Pacific_Standard_Time_2022
Cuda compilation tools, release 11.6, V11.6.124
Build cuda_11.6.r11.6/compiler.31057947_0

And I also have cuda 11.6.1 installed on pytorch but when I run the command ‘torch.cuda.is_available()’ I get the following error: ‘torch.cuda.is_available’ is not recognized as an internal or external command, operable program or batch file.

Are you trying to execute this command directly in your terminal?
Note that this line of code is Python code so you should run it in a Python script instead.

The PyTorch binaries ship with their own CUDA runtime and other CUDA libs. Your locally installed CUDA toolkit will be used if you build PyTorch from source or a custom CUDA extension.
Could you post the output of python -m torch.utils.collect_env?