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
  File "c:\Python32\lib\distutils\dist.py", line 917, in run_commands
    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 incompatible with Python 3? Has anyone succeeded in running OWSlib on Python 3?

1 Answer 1


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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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