# Testing hugging face in langchain vs code

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftesting-hugging-face-in-langchain-vs-code%2F158990%3E%5C
**Category:** Models\
**Created:** [June 12, 2025, 12:36am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftesting-hugging-face-in-langchain-vs-code%2F158990 "2025-06-12T00:36:38Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [June 12, 2025, 3:40am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftesting-hugging-face-in-langchain-vs-code%2F158990%2F2 "2025-06-12T03:40:55Z")

</div>

If it works in Colab, then you’re probably just failing to pass the token. In that case, set the `HF_TOKEN` environment variable or write` login()` in the Python code to be sure. Don’t forget to install the library beforehand.

```auto
pip install -U huggingface_hub

```

> [@Huggingface cli login error](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhuggingface-cli-login-error%2F157361)%3A
>
> logging in with access token stopped working (had no issues before), tried with 3 different tokens + on different huggingface\_hub envs, exact error trace is this Traceback (most recent call last): File “C:\comfyenv\Lib\site-packages\huggingface\_hub\utils\_http.py”, line 409, in hf\_raise\_for\_status response.raise\_for\_status() File “C:\comfyenv\Lib\site-packages\requests\models.py”, line 1024, in raise\_for\_status raise HTTPError(http\_error\_msg, response=self) requests.exceptions.HTTPError: 40…

> **[User access tokens](https://huggingface.co/docs/hub/security-tokens)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

> **[Environment variables](https://huggingface.co/docs/huggingface_hub/package_reference/environment_variables)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

---

_[View the full topic](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ftesting-hugging-face-in-langchain-vs-code%2F158990)._
