By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,097 Members | 1,580 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,097 IT Pros & Developers. It's quick & easy.

Importing xlrd

P: n/a
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.
Jun 27 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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

Jun 27 '08 #2

P: n/a
On Jun 3, 8:23 am, Chanman <bryancc...@gmail.comwrote:
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.
From the xlrd home-page (http://www.lexicon.net/sjmachin/xlrd.htm):
"""
Installation:

* Windows only: download and run this installer
xlrd-0.6.1.win32.exe. Any platform: download this ZIP file
xlrd-0.6.1.zip which you unzip into a suitable directory, then cd to
that directory, and do "python setup.py install".
"""

From the xlrd README file:
"""
Installation:

* On Windows: use the installer.
* Any OS: Unzip the .zip file into a suitable directory, chdir to
that directory, then do "python setup.py install".
* If PYDIR is your Python installation directory: the main files
are in PYDIR/Lib/site-packages/xlrd (except for Python 2.1 where they
will be in PYDIR/xlrd), the docs are in the doc subdirectory, and
there's a sample script: PYDIR/Scripts/runxlrd.py
* If os.sep != "/": make the appropriate adjustments.
"""
Jun 27 '08 #3

P: n/a
On Jun 2, 5:48 pm, John Machin <sjmac...@lexicon.netwrote:
On Jun 3, 8:23 am, Chanman <bryancc...@gmail.comwrote:
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.

From the xlrd home-page (http://www.lexicon.net/sjmachin/xlrd.htm):
"""
Installation:

* Windows only: download and run this installer
xlrd-0.6.1.win32.exe. Any platform: download this ZIP file
xlrd-0.6.1.zip which you unzip into a suitable directory, then cd to
that directory, and do "python setup.py install".
"""

From the xlrd README file:
"""
Installation:

* On Windows: use the installer.
* Any OS: Unzip the .zip file into a suitable directory, chdir to
that directory, then do "python setup.py install".
* If PYDIR is your Python installation directory: the main files
are in PYDIR/Lib/site-packages/xlrd (except for Python 2.1 where they
will be in PYDIR/xlrd), the docs are in the doc subdirectory, and
there's a sample script: PYDIR/Scripts/runxlrd.py
* If os.sep != "/": make the appropriate adjustments.
"""
Thanks, turns out I just had to type "setup.py install" in the command
line, no "python" required.

Bryan
Jun 27 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.