TF compiler version causes error with pkg_resources.parse_version (invalid format)
Hi @RainierBarrett ,

Could you please confirm how you are installing the TF package ? Are you building from source ?

I have replicated the behaviour with pip wheel and the output is same as reported by you and attached snapshot below.

<img width="1512" alt="Screenshot 2023-06-01 at 2 49 21 PM" src="https://github.com/tensorflow/tensorflow/assets/116063290/e60ddb15-5fb5-480e-90b7-a448cbee4127">

The behaviour is different with Google colab as per attached [gist](https://colab.research.google.com/gist/SuryanarayanaY/3a6703acf90aaafba89d7b7eb82c683c/60742.ipynb) and error out as below.

`InvalidVersion: Invalid version: '9.3.1 20200408'`

Tensorflow uses bazel for building TF from source.I am not sure how this issue is related /affecting Tensorflow. Could you please elaborate more.

Thanks! For this example I was grabbing TF with conda in an otherwise empty conda env. 

So you're saying the `tensorflow.__compiler_version__` is set by bazel and not TF then? @RainierBarrett ,

A small update regarding compiler for TF builds.Starting from TF 2.13v, tensorflow linux builds were compiled by using Clang16. Before that it was GCC.Same updated in [documentation](https://www.tensorflow.org/install/source#install_clang_recommended_linux_only).

So the response `'Ubuntu Clang 16.0.4 (++20230506063001+3c1576cc0c54-1~exp1~20230506063103.85)'` for `tensorflow.__compiler_version__` should be fine, but not sure why the `pkg_resources. parse_version` raising invalid argument error. 

The result is also same with Google colab with TF2.13rc1 as per [gist](https://colab.research.google.com/gist/SuryanarayanaY/7a77eedceb521fa7e90ece047061b8cc/60742_2-13v.ipynb).Earlier gist was tested on TF2.12 and its gave GCC version.

I am not sure whether the issue is with TF or not since compiler name was identified properly but erroring at same time.If you have any thoughts on this please feel free to share.

Thanks!
 Looks like setuptools are bringing down the hammer on [non-PEP440-compliant version strings.](https://github.com/pypa/setuptools/issues/3772) Since this compiler's version string isn't coming from a python package anyway, I will just have to seek out a different parsing tool for the check. The issue was indeed not due to TF or the compiler itself. Cheers! 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/60742">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/60742">No</a>

<details><summary>Click to expand!</summary> 
 
 ### Issue Type

Bug

### Have you reproduced the bug with TF nightly?

Yes

### Source

binary

### Tensorflow Version

2.14.0-dev20230531

### Custom Code

No

### OS Platform and Distribution

Linux 3.10.0-1127.el7.x86_64

### Mobile device

_No response_

### Python version

3.11.3

### Bazel version

N/A

### GCC/Compiler version

N/A

### CUDA/cuDNN version

CUDA 10.2.89

### GPU model and memory

N/A

### Current Behaviour?

**Current behavior:** The following code (in a fresh conda env with tf-nightly installed via pip) produces a `pkg_resources.extern.packaging.version.InvalidVersion` error from `parse_version`:
```python
import tensorflow
from pkg_resources import parse_version
parse_version(tensorflow.__compiler_version__)
```

**Desired Behavior:** A string that matches the format produced by cmake's `$(CMAKE_CXX_COMPILER_VERSION}`, i.e. is readable by `pkg_resources.parse_version`.

**Context:** Presently I am using this to warn against compiler mismatches at build time of a package that builds with TF libs in cmake (checks against `${CMAKE_CXX_COMPILER_VERSION}`). The build process doesn't strike me as relevant here but I will provide the build files if requested.



### Standalone code to reproduce the issue

```shell
import tensorflow
from pkg_resources import parse_version
parse_version(tensorflow.__compiler_version__)
```


### Relevant log output

```shell
>>> parse_version(tensorflow.__compiler_version__)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/rainierbarrett/.conda/envs/tf-test/lib/python3.11/site-packages/pkg_resources/_vendor/packaging/version.py", line 197, in __init__
    raise InvalidVersion(f"Invalid version: '{version}'")
pkg_resources.extern.packaging.version.InvalidVersion: Invalid version: 'Ubuntu Clang 16.0.4 (++20230506063001+3c1576cc0c54-1~exp1~20230506063103.85)'
```
</details>