Tensorflow Building from Source Code
Hi **@Nicky9319** ,
- Ensure that you have visual studio installed on your system with the necessary components for building tensorflow. This typically includes the ` desktop development with C++` workload and the `MSVC v142 - VS 2019 C++ x64/x86 build tools` component.
- Make sure that the visual studio environment variables are set correctly. You can do this by opening a developer command prompt for visual studio and running the `vcvarsall.bat` script for your target architecture (x64 or x86) and platform (Debug or Release).
- Try to clean the Bazel cache by running this command.
```
bazel clean --expunge
```

Thank you! This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/66238">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/66238">No</a>

### Issue type

Build/Install

### Have you reproduced the bug with TensorFlow Nightly?

No

### Source

source

### TensorFlow version

2.9

### Custom code

No

### OS platform and distribution

Windows 11

### Mobile device

_No response_

### Python version

3.10.0

### Bazel version

5.0.0

### GCC/compiler version

9.2.0

### CUDA/cuDNN version

11.2 , 8.1

### GPU model and memory

_No response_

### Current behavior?

I am trying to build Tensorflow from source because i want to run tensorflow using c++ and i am trying to download the GPU version
So I ran ./Configure command, and choose the option to enable GPU Support
I ran the bazel command given on the tensorflow Build From source on windows
https://www.tensorflow.org/install/source_windows

and ran into the following error, What does it imply and how can i Solve it

### Standalone code to reproduce the issue

```shell
ERROR: An error occurred during the fetch of repository 'local_config_cuda':
Traceback (most recent call last):
File "D:/tensorflow/tensorflow-2.9.0/third_party/gpus/cuda_configure.bzl", line 1401, column 38, in _cuda_autoconf_impl
_create_local_cuda_repository(repository_ctx)
File "D:/tensorflow/tensorflow-2.9.0/third_party/gpus/cuda_configure.bzl", line 1179, column 17, in _create_local_cuda_repository
cc = find_cc(repository_ctx)
File "D:/tensorflow/tensorflow-2.9.0/third_party/gpus/cuda_configure.bzl", line 216, column 34, in find_cc
return _get_msvc_compiler(repository_ctx)
File "D:/tensorflow/tensorflow-2.9.0/third_party/gpus/cuda_configure.bzl", line 133, column 26, in _get_msvc_compiler
return find_msvc_tool(repository_ctx, vc_path, "cl.exe").replace("\", "/")
File "C:/users/paart/_bazel_paart/3pmtytha/external/bazel_tools/tools/cpp/windows_cc_configure.bzl", line 447, column 27, in find_msvc_tool
if _is_vs_2017_or_2019(repository_ctx, vc_path) or _is_msbuildtools(vc_path):
File "C:/users/paart/_bazel_paart/3pmtytha/external/bazel_tools/tools/cpp/windows_cc_configure.bzl", line 265, column 72, in _is_vs_2017_or_2019
vc_path_contents = [d.basename.lower() for d in repository_ctx.path(vc_path).readdir()]
Error in path: in call to path(), parameter 'path' got value of type 'NoneType', want 'string, Label, or path'
ERROR: D:/tensorflow/tensorflow-2.9.0/WORKSPACE:15:14: fetching cuda_configure rule //external:local_config_cuda: Traceback (most recent call last):
File "D:/tensorflow/tensorflow-2.9.0/third_party/gpus/cuda_configure.bzl", line 1401, column 38, in _cuda_autoconf_impl
_create_local_cuda_repository(repository_ctx)
File "D:/tensorflow/tensorflow-2.9.0/third_party/gpus/cuda_configure.bzl", line 1179, column 17, in _create_local_cuda_repository
cc = find_cc(repository_ctx)
File "D:/tensorflow/tensorflow-2.9.0/third_party/gpus/cuda_configure.bzl", line 216, column 34, in find_cc
return _get_msvc_compiler(repository_ctx)
File "D:/tensorflow/tensorflow-2.9.0/third_party/gpus/cuda_configure.bzl", line 133, column 26, in _get_msvc_compiler
return find_msvc_tool(repository_ctx, vc_path, "cl.exe").replace("\", "/")
File "C:/users/paart/_bazel_paart/3pmtytha/external/bazel_tools/tools/cpp/windows_cc_configure.bzl", line 447, column 27, in find_msvc_tool
if _is_vs_2017_or_2019(repository_ctx, vc_path) or _is_msbuildtools(vc_path):
File "C:/users/paart/_bazel_paart/3pmtytha/external/bazel_tools/tools/cpp/windows_cc_configure.bzl", line 265, column 72, in _is_vs_2017_or_2019
vc_path_contents = [d.basename.lower() for d in repository_ctx.path(vc_path).readdir()]
Error in path: in call to path(), parameter 'path' got value of type 'NoneType', want 'string, Label, or path'
INFO: Found applicable config definition build:cuda in file d:\tensorflow\tensorflow-2.9.0.bazelrc: --repo_env TF_NEED_CUDA=1 --crosstool_top=@local_config_cuda//crosstool:toolchain --@local_config_cuda//:enable_cuda
ERROR: @local_config_cuda//:enable_cuda :: Error loading option @local_config_cuda//:enable_cuda: in call to path(), parameter 'path' got value of type 'NoneType', want 'string, Label, or path'
```


### Relevant log output

_No response_