473,289 Members | 1,952 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,289 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 19287
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: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.