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.

Trying to install OWSlib-master (and 0.7.1) from https://github.com/geopython/OWSLib yields problems that ultimately seem to be related to python3

>c:\Python32\python.exe setup.py install
running install
running bdist_egg
running egg_info
writing requirements to OWSLib.egg-info\requires.txt
writing OWSLib.egg-info\PKG-INFO
Traceback (most recent call last):
  File "setup.py", line 34, in <module>
    packages      = find_packages(),
  File "c:\Python32\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "c:\Python32\lib\distutils\dist.py", line 917, in run_commands
    self.run_command(cmd)
  [...]
    lines = header.split('\n')
TypeError: Type str doesn't support the buffer API

Are those errors errors of my (ActivePython 3.2) installation, or are these errors of OWSLib being incopatible with python 3? Has anyone succeded in running OWSlib on python 3?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

In Python 3 this is an owslib setup bug at https://github.com/geopython/OWSLib/blob/master/setup.py#L20. The value of

open('README.txt', 'rb').read()

is of type 'bytes' in Python 3. The setup script needs to do this

open('README.txt', 'r').read()

to get the expected 'str' type value.

share|improve this answer
    
FYI this is now fixed in OWSLib. Thanks Sean! –  tomkralidis May 14 '13 at 21:54
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.