Problem scenario
You have a Python program use an import statement, but the program fails. From the Python command prompt, you can import the module. Why is it different?
Possible Solution #1
You may be using Python version 3 for either the command prompt or the program and Python version 2 for the complement (either the command prompt or the program). Try these commands:
python –version
python3 –version
Possible Solution #2
See where the potential imports are.
…