>>> import openpyxl
fr
>>> from openpyxl.cell import get_column_letter, column_index_from_string
Traceback (most recent call last):
File "<pyshell#8>", line 1, in <module>
from openpyxl.cell import get_column_letter, column_index_from_string
ImportError: cannot import name 'get_column_letter' from 'openpyxl.cell' (C:\Users\james\AppData\Roaming\Python\Python37\site-packages\openpyxl\cell\__init__.py)
>>> get_column_letter(1)
Traceback (most recent call last):
File "<pyshell#9>", line 1, in <module>
get_column_letter(1)
NameError: name 'get_column_letter' is not defined
>>>
=============================== RESTART: Shell ===============================
>>> import openpyxl
f
>>>
=============================== RESTART: Shell ===============================
>>> import openpyxl
>>> from openpyxl.cell import get_column_letter
Traceback (most recent call last):
File "<pyshell#12>", line 1, in <module>
from openpyxl.cell import get_column_letter
ImportError: cannot import name 'get_column_letter' from 'openpyxl.cell' (C:\Users\james\AppData\Roaming\Python\Python37\site-packages\openpyxl\cell\__init__.py)
Well, apparently the Automate the Boring Stuff with Python is a little out of date now! According to a StackOverflow contributor,
fr
>>> from openpyxl.cell import get_column_letter, column_index_from_string
Traceback (most recent call last):
File "<pyshell#8>", line 1, in <module>
from openpyxl.cell import get_column_letter, column_index_from_string
ImportError: cannot import name 'get_column_letter' from 'openpyxl.cell' (C:\Users\james\AppData\Roaming\Python\Python37\site-packages\openpyxl\cell\__init__.py)
>>> get_column_letter(1)
Traceback (most recent call last):
File "<pyshell#9>", line 1, in <module>
get_column_letter(1)
NameError: name 'get_column_letter' is not defined
>>>
=============================== RESTART: Shell ===============================
>>> import openpyxl
f
>>>
=============================== RESTART: Shell ===============================
>>> import openpyxl
>>> from openpyxl.cell import get_column_letter
Traceback (most recent call last):
File "<pyshell#12>", line 1, in <module>
from openpyxl.cell import get_column_letter
ImportError: cannot import name 'get_column_letter' from 'openpyxl.cell' (C:\Users\james\AppData\Roaming\Python\Python37\site-packages\openpyxl\cell\__init__.py)
Well, apparently the Automate the Boring Stuff with Python is a little out of date now! According to a StackOverflow contributor,
The functionThe .utils instead of .cell directory worked.get_column_letter
has been relocated in Openpyxl version 2.4 fromopenpyxl.cell
toopenpyxl.utils
.
The current import is:from openpyxl.utils import get_column_letter
No comments:
Post a Comment