# Can't login to Huggingface CLI

**URL:** <https://discuss.huggingface.co/t/cant-login-to-huggingface-cli/139741>\
**Category:** Beginners\
**Created:** [February 8, 2025, 6:18pm UTC](https://discuss.huggingface.co/t/cant-login-to-huggingface-cli/139741 "2025-02-08T18:18:54Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![Wauplin](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/wauplin/32/40815_2.png) [@Wauplin](https://discuss.huggingface.co/u/Wauplin)\
**Post date:** [February 10, 2025, 11:41am UTC](https://discuss.huggingface.co/t/cant-login-to-huggingface-cli/139741/11 "2025-02-10T11:41:32Z")

</div>

Hi @nishadsinghi sorry for the inconvenience. Could you try to login using a script just to be 100% sure it’s not a encoding issue with the terminal:

```py
from huggingface_hub import login, whoami

login(token="hf_....")
whoami()

```

Also, could you install `huggingface_hub` from source (see [install steps](https://huggingface.co/docs/huggingface_hub/installation#install-from-source)) and retry? We’ve recently pushed a small feature that tells you which token has been used when `whoami` fails. Sometimes it can be due to an environement vairable (`HF_TOKEN`) mixing with the locally saved one.

* * *

**Note:** `huggingface_hub`/`huggingface-cli` are only using HTTP calls and are completely separated from `git`. There is nothing you can do on the git side that breaks huggingface-cli (and therefore nothing you can do to fix it using git)

---

_[View the full topic](https://discuss.huggingface.co/t/cant-login-to-huggingface-cli/139741)._
