8

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!

Mark Kennedy
  • 1,751
  • 6
  • 30
  • 53

2 Answers2

15

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
Spike Williams
  • 35,795
  • 13
  • 48
  • 60
2

I just installed a different version of xlwt and it worked.

Mark Kennedy
  • 1,751
  • 6
  • 30
  • 53