472,353 Members | 1,559 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

Importing xlrd

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
3 19173
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: John Machin | last post by:
I am pleased to announce a new general release (0.5.2) of xlrd, a Python package for extracting data from Microsoft Excel spreadsheets. CHANGES:...
11
by: Tempo | last post by:
Hello. I am getting the error that is displayed below, and I know exactly why it occurs. I posted some of my program's code below, and if you look...
2
by: BrendanC | last post by:
I've started learninhg Python and have developed a small Python app that imports Excel data into an Access mdb/jet database. This application has...
2
by: kylancal | last post by:
I am trying to read an Excel book with XLRD and I am getting the following error Traceback (most recent call last): File...
1
by: JYOUNG79 | last post by:
When running 'python setup.py install' to install items for xlrd to work, does anybody know what items are installed and where items are installed...
1
by: Krishna | last post by:
I want to delete some rows (by creating a loop may be) using xlrd. Is this possible, if not how do I do that with python? Please help Thanks...
1
by: Edwin.Madari | last post by:
here is working code that will read & display contents of all rows & columns in all the sheets, you need xlrd 0.6.1 import xlrd, os, sys book...
2
by: patrick.waldo | last post by:
Hi all, I am trying to figure out a way to read colors with xlrd, but I did not understand the formatting.py module. Basically, I want to sort...
6
by: ronparker | last post by:
Hello, This is my first time posting and just my second day using python on mysql, so please be patient with me. I should also say, I am using a...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.