Saurabh B Saurabh B - 2 months ago 144
Python Question

from openpyxl.styles import Style, Font ImportError: cannot import name Style

While running a python code, I am facing the following error :

sbassi-mbpro:FacebookEventScraper-master sbassi$ python facebook_event_scraper.py
Traceback (most recent call last):
File "facebook_event_scraper.py", line 13, in <module>
from openpyxl.styles import Style, Font
ImportError: cannot import name Style

python -V
Python 2.7.10

Answer

Looking at the source code for openpyxl.styles, the __init__.py file doesn't define any name: Style.

Perhaps you were looking for NamedStyle instead?

Comments