Python installing xlwt module error

Mark Kennedy picture Mark Kennedy · Aug 10, 2013 · Viewed 7.4k times · Source

I unzipped xlwt and tried to install from that directory, but I get the following error.

>> python setup.py install


Traceback (most recent call last):
File "setup.py", line 4, in <module>
   from xlwt import __VERSION__
File "C:\Users\mypc\Desktop\xlwt-0.7.5\xlwt\__init__.py", line 3, in <module>
    from Workbook import Workbook
ImportError: No module named 'Workbook'

Here's the init.py that's giving the error

__VERSION__ = '0.7.5'


from Workbook import Workbook
from Worksheet import Worksheet
from Row import Row
from Column import Column
from Formatting import Font, Alignment, Borders, Pattern, Protection
from Style import XFStyle, easyxf, easyfont, add_palette_colour
from ExcelFormula import *

Anyone know what's causing this error? I need xlwt to write to excel spreadsheets!

Answer

Spike Williams picture Spike Williams · Feb 13, 2014

xlwt is Python 2.x compatable, and does not seem to work on Python 3.x. "xlwt-future" is a fork of xlwt that works for Python 3:

pip install xlwt-future