Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python installing xlwt module error

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!

like image 329
Mark Kennedy Avatar asked Aug 10 '13 00:08

Mark Kennedy


2 Answers

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
like image 125
Spike Williams Avatar answered Oct 23 '22 15:10

Spike Williams


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

like image 22
Mark Kennedy Avatar answered Oct 23 '22 14:10

Mark Kennedy