# Testing hugging face in langchain vs code

**URL:** <https://discuss.huggingface.co/t/testing-hugging-face-in-langchain-vs-code/158990>\
**Category:** Models\
**Created:** [June 12, 2025, 12:36am UTC](https://discuss.huggingface.co/t/testing-hugging-face-in-langchain-vs-code/158990 "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](https://discuss.huggingface.co/u/John6666)\
**Post date:** [June 12, 2025, 3:40am UTC](https://discuss.huggingface.co/t/testing-hugging-face-in-langchain-vs-code/158990/2 "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](https://discuss.huggingface.co/t/huggingface-cli-login-error/157361):
>
> 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](https://discuss.huggingface.co/t/testing-hugging-face-in-langchain-vs-code/158990)._
