# Unable to import transformers using my jupyter notebook

**URL:** <https://dlai.staged-by-discourse.com/t/unable-to-import-transformers-using-my-jupyter-notebook/706821>\
**Category:** Sequence Models\
**Tags:** week-module-4, coursera-platform\
**Created:** [October 11, 2024, 5:01pm UTC](https://dlai.staged-by-discourse.com/t/unable-to-import-transformers-using-my-jupyter-notebook/706821 "2024-10-11T17:01:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarcoS145](https://sea1.discourse-cdn.com/dlaistaging/user_avatar/dlai.staged-by-discourse.com/marcos145/32/81372_2.png) [@MarcoS145](https://dlai.staged-by-discourse.com/u/MarcoS145)\
**Post date:** [October 11, 2024, 5:01pm UTC](https://dlai.staged-by-discourse.com/t/unable-to-import-transformers-using-my-jupyter-notebook/706821/1 "2024-10-11T17:01:19Z")

</div>

Hello – I’m just now starting the Transformer lab. I just scanned a lot of the comments, and I can see this going to be a real challenge. My mode of working during this course has been to download all the lab files and work them in on my Jupyter notebook. That works good for me since I often have to leave the computer which on the Coursera website would result in lots of session time outs. I’ve routinely encountered solvable issues where a particular library needed to be imported that was not already in my environment. **This time, however** , I am not able to import transformers when running the following statements near the beginning of the lab. I will work in the Coursera environment for now, but I’d really like to end up with my own working version of this lab. Any help with this manner would be appreciated.

from transformers import DistilBertTokenizerFast #, TFDistilBertModel  
from transformers import TFDistilBertForTokenClassification

---

<div class="post-metadata">

**Author:** ![paulinpaloalto](https://sea1.discourse-cdn.com/dlaistaging/user_avatar/dlai.staged-by-discourse.com/paulinpaloalto/32/187_2.png) [@paulinpaloalto](https://dlai.staged-by-discourse.com/u/paulinpaloalto)\
**Post date:** [October 11, 2024, 5:17pm UTC](https://dlai.staged-by-discourse.com/t/unable-to-import-transformers-using-my-jupyter-notebook/706821/2 "2024-10-11T17:17:20Z")

</div>

The APIs of all the packages we use are not stable over time. Most of the notebooks in the course were last updated in a major way in April of 2021. There is no guarantee that they will work with the current version of TF/Keras or any of the other packages. If you want to work in your local environment, you have a fundamental choice to make:

1. Duplicate the versions of all the packages using something like Conda.
2. Solve each compatibility problem as you encounter it.

If you want to explore the “duplicate versions” strategy, there are no official instructions, but [here’s a thread](http://dlai.staged-by-discourse.com/t/dls-1-my-own-project-in-pycharm/74781/4) that has lots of useful information to get you started down that long and winding road.

---

<div class="post-metadata">

**Author:** ![MarcoS145](https://sea1.discourse-cdn.com/dlaistaging/user_avatar/dlai.staged-by-discourse.com/marcos145/32/81372_2.png) [@MarcoS145](https://dlai.staged-by-discourse.com/u/MarcoS145)\
**Post date:** [October 11, 2024, 5:25pm UTC](https://dlai.staged-by-discourse.com/t/unable-to-import-transformers-using-my-jupyter-notebook/706821/3 "2024-10-11T17:25:50Z")

</div>

Thanks Paul - I’ve been solving compatibility issues as they’ve come up but it looks like its not worth the time in this case. Thanks for confirming - I’ll just work in the Coursera environment.  
Marc
