# Getting error in importing TFTrainer

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgetting-error-in-importing-tftrainer%2F77416%3E%5C
**Category:** 🤗Transformers\
**Created:** [March 14, 2024, 1:17pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgetting-error-in-importing-tftrainer%2F77416 "2024-03-14T13:17:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shivdattaredekar](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@shivdattaredekar](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fshivdattaredekar)%5C
**Post date:** [March 14, 2024, 1:17pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgetting-error-in-importing-tftrainer%2F77416%2F1 "2024-03-14T13:17:11Z")

</div>

i tried importing TFTTrainer with below code

from transformers import TFDistilBertForSequenceClassification, TFTrainer, TFTrainingArguments

## but got the below error 🙂

ImportError Traceback (most recent call last)  
Cell In[85], line 1  
----\> 1 from transformers import TFDistilBertForSequenceClassification, TFTrainer, TFTrainingArguments

ImportError: cannot import name ‘TFTrainer’ from ‘transformers’ (C:\Users\sredekar\AppData\Roaming\Python\Python311\site-packages\transformers\__init_\_.py)

can anyone help 🙂

---

<div class="post-metadata">

**Author:** ![skushwa1](https://avatars.discourse-cdn.com/v4/letter/s/76d3ee/32.png) [@skushwa1](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fskushwa1)%5C
**Post date:** [July 22, 2024, 7:03pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fgetting-error-in-importing-tftrainer%2F77416%2F2 "2024-07-22T19:03:26Z")

</div>

I am sharing one solution that I found, I hope this helps try installing !pip install transformers==4.18.0 as newer versions does not support TFTrainer.

🙂
