Cannot import pipelines from transformers
Author: balachander1964
Pull request: no

Hi, I use a Windows 10 Proffessional laptop for development and am using python 3.7.6 conda virtual env. I get the following run time error when running my code (below, after the error details).
<<
bertqa interactive window [PTVS 17.0.22089.1-17.0]
Type $help for a list of commands.
The interactive window has not yet started.
Running D:\Projects2017\bertqa\bertqa\aaa_scratch.py
Traceback (most recent call last):
  File "d:\python\Anaconda3\envs\transformers_qa\lib\site-packages\transformers\utils\import_utils.py", line 905, in _get_module
    return importlib.import_module("." + module_name, self.__name__)
  File "d:\python\Anaconda3\envs\transformers_qa\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "d:\python\Anaconda3\envs\transformers_qa\lib\site-packages\transformers\pipelines\__init__.py", line 50, in <module>
    from .image_classification import ImageClassificationPipeline
  File "d:\python\Anaconda3\envs\transformers_qa\lib\site-packages\transformers\pipelines\image_classification.py", line 15, in <module>
    from PIL import Image
  File "d:\python\Anaconda3\envs\transformers_qa\lib\site-packages\PIL\Image.py", line 69, in <module>
    from . import _imaging as core
ImportError: DLL load failed: The specified module could not be found.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "D:\Projects2017\bertqa\bertqa\aaa_scratch.py", line 5, in <module>
    from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipelines
  File "<frozen importlib._bootstrap>", line 1032, in _handle_fromlist
  File "d:\python\Anaconda3\envs\transformers_qa\lib\site-packages\transformers\utils\import_utils.py", line 893, in __getattr__
    value = self._get_module(name)
  File "d:\python\Anaconda3\envs\transformers_qa\lib\site-packages\transformers\utils\import_utils.py", line 910, in _get_module
    ) from e
RuntimeError: Failed to import transformers.pipelines because of the following error (look up to see its traceback):
DLL load failed: The specified module could not be found.
>>> 
>>

The following is the code I am trying to execute:
<<
#imports
import os, sys
import pandas as PD
import numpy as NP
from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipelines

_text = 'I bought a Toyota Corala last January. It works well..'
_questions = [
  'What did the person buy?',
  'What is working?',
  'When did he buy?',
  ]

_model_name = "deepset/tinyroberta-squad2"

def main():
  '''Main entry point'''
  nlp = pipeline('question-answering', model=model_name, tokenizer=model_name)
  qa_input = {}
  qa_input['question'] = _questions[0]
  qa_input['context'] = _text

  answer = nlp(QA_input)
  print(answer)

'''
Required for all python programs.
'''
if __name__ == '__main__':
  print('Starting the QA tool.')
  main()
  print('Done')
>>

I will appreciate if you let me know how to overcome this issue. Awaiting your reply.

Comments:
Hi @balachander1964 -- if you check the error log you shared, the error does not come from the `transformers` library. From a quick google search, the error seems to be from the environment set up (try googling `DLL load failed: The specified module could not be found.`)

As per our [issues guidelines](https://github.com/huggingface/transformers/blob/main/ISSUES.md), we reserve GitHub issues for bugs in the repository and/or feature requests. For any other matters, we'd like to invite you to use our [forum](https://discuss.huggingface.co/) 🤗

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.