To enter token in jupyter notebook issue
Author: arda1906
Pull request: no

I run this [from huggingface_hub import notebook_login
notebook_login() ] on cell and enter my token. but it doesn't work:(

Comments:
Hi @arda1906, thanks for raising an issue!

Without more information about the error i.e. what does it mean to "not work" and what is the expected behaviour? we won't be able to help you.  

From the snippet, it's not entirely clear how the code is being run, but there are two separate commands which should be entered on separate lines or cells

```py
from huggingface_hub import notebook_login

notebook_login()
```

hi,I am giving details
> I am trying this code to train the model

>```python
>trainer = Trainer(model=model,args=training_args,
                 compute_metrics=compute_metrics,
                 train_dataset=emotion_encoded["train"],
                 eval_dataset=emotion_encoded["validation"],
                 tokenizer=tokenizer)
trainer.train()

>and I am facing this error:
>LocalTokenNotFoundError: Token is required (`token=True`), but no token found. You need to provide a token or be logged in to Hugging Face with `huggingface-cli login` or `huggingface_hub.login`. See https://huggingface.co/settings/tokens.
>I have thought to apply the my token in the jupyter notebook like this:
>```
> ```python
> from huggingface_hub import notebook_login
> 
> notebook_login()
>
> ```
>help me please:(


Hi @arda1906, are you running the notebook login cells before calling Trainer? Are you passing in a token to the interactive text box that appears when running notebook_login? 

> Hi @arda1906, are you running the notebook login cells before calling Trainer? Are you passing in a token to the interactive text box that appears when running notebook_login?

![20240221_210517](https://github.com/huggingface/transformers/assets/157398066/57ee7c71-1614-4c44-8dc2-144f47cafacd)


Hi @arda1906, without more context to the screenshots, it's hard to know what's going on here. 

For example:
* When is the cell for the first image run? In which cell? 
* What happens when you enter your HF token? Is this the error we see in the second image? 

I can see in the cell in the second image, you're running `pip` as a python command. To run a cli command in a jupyter cell, you need to add a `!` prefix i.e. `! pip install huggingface_hub[cli,torch]`.

I'm not sure about the `WinError 2` error - it looks like it's not able to find the necessary python files. 

I'd suggest restarting your notebook with a fresh environment, running the pip command in the first cell, and then the notebook login in the second cell to see if that works first, independent of any of the other code.  

I'd advise using a tool to take a screenshot directly, rather than from a phone, as this will make the image a lot clearer. Even better would be to share the notebook directly - this would provide all the context and necessary information to be able to try and help.

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.