Importing xlrd

Gary Herron gherron at islandtraining.com
Tue Jun 3 02:18:06 CEST 2008


Chanman wrote:
> This is probably a simple question to most of you, but here goes.
> I've downloaded the xlrd (version 0.6.1) module and placed in in the
> site-packages folder.  Now, when I write a script, I type:
>
> import sys
> import xlrd
>
> When I run it, there is an import error saying there is no module
> named xlrd.  However when I type sys.path, the site-packages folder is
> definitely in the path.  Do I somehow need to run the xlrd setup.py
> first before importing?
>
> Any help would be appreciated.
> --
> http://mail.python.org/mailman/listinfo/python-list
>   
On what system?  Windows or Unix?  Which download?  The exe or the zip?

I'm guessing you downloaded the zip file on a Unix or Linux system.  If 
so, you should not copy the files into the site-package directory 
yourself.  You are supposed to use the included setup.py file like this:

  unzip into some local directory
  cd into that directory
  python setup.py build
  python setup.py install

Then your import should work fine.


Gary Herron




More information about the Python-list mailing list