Transformer is not compatible with Python 3.11.0
Author: donhuvy
Pull request: no

### System Info

```
Microsoft Windows [Version 10.0.22621.674]
(c) Microsoft Corporation. All rights reserved.

C:\Users\donhu>wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
'wget' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\donhu># For security purposes, please check the contents of collect_env.py before running it.
'#' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\donhu>python collect_env.py
python: can't open file 'C:\\Users\\donhu\\collect_env.py': [Errno 2] No such file or directory

C:\Users\donhu>cd d:
D:\

C:\Users\donhu>cd /d D:

D:\>python collect_env.py
Collecting environment information...
PyTorch version: N/A
Is debug build: N/A
CUDA used to build PyTorch: N/A
ROCM used to build PyTorch: N/A

OS: Microsoft Windows 11 Pro
GCC version: Could not collect
Clang version: Could not collect
CMake version: Could not collect
Libc version: N/A

Python version: 3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit (AMD64)] (64-bit runtime)
Python platform: Windows-10-10.0.22621-SP0
Is CUDA available: N/A
CUDA runtime version: 11.7.64
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: GPU 0: NVIDIA GeForce GTX 1660 SUPER
Nvidia driver version: 512.77
cuDNN version: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.7\bin\cudnn_ops_train64_8.dll
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: N/A

Versions of relevant libraries:
[pip3] numpy==1.23.4
[conda] Could not collect

D:\>
```

### Who can help?

@donhuvy

### Information

- [ ] The official example scripts
- [ ] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

Use project https://github.com/donhuvy/vy_thesis

Set up project. Transformer is not compatible with Python 3.11.0

### Expected behavior

Transformer is compatible with Python 3.11.0

Comments:
Hey @donhuvy, I don't see anything specific to `transformers`, only to `torch`. How is this related to transformers?

It is https://github.com/donhuvy/vy_thesis/blob/main/source/train.py#L22

```
tokenizer=transformers.AutoTokenizer.from_pretrained(hyps_file["encoder"], use_fast=False),
```
From your experience, Are you sure transformer and other of transformer's dependencies work ok with Python 3.11.0?

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.

Is support for Python 3.11 available now?
Please share details.
Thanks

As mentioned in the comments above, the problem came from a soft dependency of Transformers (PyTorch). I think they support Python 3.11 now but bet to ask on their repo/forums if you are encountering any issue :-)

According to my tests, the latest `huggingface/transformers` installation on Python 3.11 fails because it tries to install `sentencepiece==0.1.97`.

![Screenshot 2023-07-25 at 8 54 47](https://github.com/huggingface/transformers/assets/12232897/f92d74d5-213d-4295-a900-40b46fdf12b9)

[sentencepiece==0.1.98 is enabled for Python 3.11](https://github.com/google/sentencepiece/issues/810)
Could you please change `huggingface/transformers` requirement to `sentencepiece==0.1.98` ??


We do not pin [`sentencepiece`](https://github.com/huggingface/transformers/blob/ee1eb3b325ce360bbd6c910c1402bca9dfb418f9/setup.py#L165), so the upper bound comes from something in your environment, not Transformers. In fact our CI (which run `pip install transformers[all]`) installs `sentencepiece==0.1.99`.