xlrd is a module that allows Python to read data from Excel files. This tutorial explains where to get it and how to install it.
Downloading the Python Xlrd Module
- The Python xlrd (short for "Excel Read") module can be found here. After downloading it, you can extract the contents (twice) with 7 Zip.
- Copy the path of the folder that holds "setup.py".
- Note that there's also a Python module for writing MS Excel files. It's called xlwt ("Excel Write") and can be found here.
- The installation process is basically identical to installing xlrd as explained below.
Adding an Environment Variable

- The installation process is basically identical for Windows 8, Windows 7, Windows Vista and even Windows XP.
- First, right click
. Then select
.

- At the end of the path, add the path to the folder in which "python.exe" is located. For most SPSS versions this will be something like
;C:\Python27
. However, for more recent versions of SPSS, Python is installed in the SPSS installation folder, for example C:\Program Files\IBM\SPSS\Statistics\22\Python - Confirm by clicking "Ok". At a later step, we'll call Python from the Windows Command Line. This step ensures that
python
is recognized as an existing application when this is done.
Installing the Python Xlrd Module
Now we'll access the MS Windows Command Prompt. On recent Windows versions, you may need to run the command prompt as an administrator. If you search your programs for cmd
, the command prompt should come up. Right-click it and select "Run as administrator".

Now we'll first set the folder where "setup.py" is located as the default directory, for example by chdir /D D:\Downloads\xlrd-0.9.2.tar\dist\xlrd-0.9.2\xlrd-0.9.2
. Note that the path can be pasted into the window with a right mouse click. All that's now left to do is the actual installation by running python setup.py install
. After doing so, you should be good to go.

THIS TUTORIAL HAS 17 COMMENTS:
By Ruben Geert van den Berg on September 20th, 2016
Hi Bob! Which OS and SPSS version are you using? Could you give me some details of what happens when you try to install it?
A recent client successfully installed XLRD on SPSS 23, I believe on Windows 8.1. simply by following this tutorial carefully.
I personally ran into some complications on my new laptop which I fixed by using an .msi (Microsoft Installer file) version of this module. However, this required me to create a windows registry key manually which may be hard for most other users. Anyway, there's at least 2 approaches that got the job done (well, we really had to get in done in both cases as XLRD is absolutely required for my website).
Neither method required any setuptools by the way.
By Paul Gem Amit on September 22nd, 2016
I can't proceed to the last step there is an error occur. 'python' is not recognize as an internal or external command
By Val on December 21st, 2016
Hi I also encountered the error "'python' is not recognize as an internal or external command" when I worked in the command prompt. Did folks find a way to resolve this issue?
By Ruben Geert van den Berg on December 22nd, 2016
Hi Val! No, I never had any trouble with the XLRD module. I'd love to help out but I don't really have any means to troubleshoot the error.
By Jozef on June 10th, 2019
Dear Ruben, we tried to instal xlrd module on our PC. We have use SPSS 25 (of course with Python). When we carefully followed your instruction, at the end of the process we saw this error message:
"Traceback (most recent call last):
File "setup.py", line 1, in
from setuptools import setup
ImportError: No module named setuptools".
My I kindly advise you, how to fix it and what is it related to? Many thanks.