ModuleNotFoundError: No module named 'transformers'
Hi! I’ve been having trouble gettingtransformersto work in Spaces.When tested in my environment usingpython -c "from transformers import pipeline; print(pipeline('sentiment-analysis')('we love you'))", the results show it’s been properly installed. When imported in Colab it works fine too, but whenever deployed to Spaces it always returns the same ModuleNotFound error. Full traceback message:Traceback:File "/home/user/.local/lib/python3.8/site-packages/streamlit/script_runner.py", line 354, in _run_script
    exec(code, module.__dict__)File "/home/user/app/app.py", line 1, in <module>
    from transformers import pipelineIt’s a simple test app usingtransformersandstreamlit, - both of which were reinstalled with pip after creating a new venv and reinstalling tensorflow and pytorch. I also tried cleaning, uninstalling, and reinstalling conda based on advice from another forum. No dice.Currently using:Python 3.9.4Tensorflow 2.7.0PyTorch 1.10.0Transformers 4.12.3Streamlit 1.2.0Any help greatly appreciated! Thanks
2021-11-12T06:41:54Z
it might be due to not having a requirements file. Here is an example of what your spaces app should have -flax-community/image-captioning at maintry adding the requirements as they till the environment what packages to load. Hope this helps.
2021-11-19T23:23:39Z
That worked perfectly. Thank you!