Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I need to use the XYtools plugin to read an Excel file. After choosing the XYtools incon and indicating an Excel file to read in, a message appears "there is a problem with loading a python module which is needed to read/write Excel files. ... see documentation/help on how to install the xlw and xlwd libraries." I found the site where the Python items reside but I cannot understand at all what to do next. Apparently the needed Python libraries are not installed with XYtools. I would appreciate being pointed to somewhere that might give some help with exactly what to do to get XYtools to work with Excel files.
Thanks -

share|improve this question
add comment

3 Answers 3

up vote 4 down vote accepted

To continue the suggestion by Alister on the qgis-users maillist, since you've installed using the OSGeo4W installer, then just

  • rerun the osgeo-setup.exe, and choose "Advanced Install" in the first window.
  • Click Next->Next a few times till you get to the "Select Packages" window.
  • Here you click on the '+' in the Libs section to open the full list. Scroll down to find the python-xlrd and python-xlwt packages, and select them to be installed (click on the double cirular arrow symbol).
  • After it finishes, open QGIS, and try the XYTools plugin. Should be OK...
share|improve this answer
    
That worked! Thanks a lot! I can read in the Excel file. –  HealthMaps Aug 12 '12 at 8:13
    
When the Excel file was read in with XYtools all the columns that were numerical in Excel are text in the temporary layer. This seems to be a real downside to QGIS to read in numerical data as text and then have to convert. What is the reason for this? –  HealthMaps Aug 12 '12 at 8:19
    
@HealthMaps Have a look at Shepherdjo's response here gis.stackexchange.com/a/29607/8227 Er... nevermind, you've obviously seen that one. –  Geoist Aug 12 '12 at 8:57
1  
For the record: on Linux systems (here, Fedora), install them as this: yum install python-xlwt python-xlrd –  markusN Aug 14 '12 at 12:05
    
also just for the record. On windows with qgis 1.8 standalone installer: just extract the two archives *.gz (from pypi.python.org/pypi/xlwt and pypi.python.org/pypi/xlrd) and copy the folders xlrd and xlwt into your qgis at c:\program files(x86)\quantumGIS Lisboa\apps\Python27\Lib and install afterwards xytools ... –  Kurt Sep 16 '12 at 17:53
add comment

XY Tools requires extra Python modules to be installed before some of its features will work. The xlw and xlrd modules can be installed via normal Python package/module methods, which will generally install in your system's site-packages for Python.

Using pip is probably your best bet. First install pip, then install the noted packages. Relaunch QGIS to test for proper loading of plugin. QGIS will find installed modules from normal Python system paths.

share|improve this answer
    
Great! But I found out now that python-xlw have changed to pyton-xlwt /Cheers –  user10236 Sep 15 '12 at 14:47
add comment

FYI: There is also FreeXL which might be integrated into QGIS.

FreeXL is an open source library to extract valid data from within an Excel (.xls) spreadsheet. https://www.gaia-gis.it/fossil/freexl/index

share|improve this answer
    
The routine in XYtools is set up for making a point layer from an Excel file that has X & Y coordinates, like locations of disease cases with various attributes. If one has no X & Y coordinates then it will make one up for you (one X and one Y) so that you get a point vector file. It looks like FreeXL is/can be integrated into Spatialite which (i guess) means one could read in a Excel file that is not intended for a point file as an attribute file for use later. Don't know much about Spatialite. –  HealthMaps Aug 13 '12 at 7:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.