473,396 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 19295
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: * Book and sheet objects can now be pickled and...
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 at it you will see that the error terminates the...
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 dependencies on the following: XLRD -...
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 "C:\temp\ReadGoldmanExcelFiles.py", line 62, in <module> startRow = 0,...
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 at on a Mac (OS 10.4)? I'm assuming it mainly...
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 Krishna
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 = xlrd.open_workbook(sys.argv) print "The number...
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 rows that are red or green. My initial attempt...
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 linux machine. Using python I was able to make a...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.