ImportError: cannot import name get_column_letter
The function get_column_letter
has been relocated in Openpyxl version 2.4 from openpyxl.cell
to openpyxl.utils
.
The current import is: from openpyxl.utils import get_column_letter
If you do not know which version the end-user has, you can use the following code:
try:
from openpyxl.cell import get_column_letter
except ImportError:
from openpyxl.utils import get_column_letter
from openpyxl.utils import get_column_letter
This is working for Python3 also.