Pages

Sunday, October 2, 2011

Pyshp Compatibility

Thanks to some outstanding work by a contributor, pyshp is now compatible with Python 2.4 to 3.x.  Before I was maintaining a separate code base for Python 3 which was falling behind.  Now everything is merged in the subversion trunk and you can use pyshp 1.1.4 or higher with either major version.

2 comments:

  1. Hello everybody,

    I tried to install pyshp on python3, but failed - as there are no setuptools for python3 I can't even use "python setup.py install". Can anybody tell me if there's a way to install pyshp on my machine.

    Thanks
    Helmut

    ReplyDelete
  2. Helmut,

    Download pyshp from:
    http://pyshp.googlecode.com/svn/trunk/shapefile.py

    Place shapefile.py in you Python3 "site-packages" directory.

    For example - on my win32 machine it goes in:

    c:\python32\Lib\site-packages\shapefile.py

    However you don't even have to install it. Just place shapefile.py in your current working directory.

    In either case you should be able to import it:

    >>> import shapefile
    >>>

    I apologize I haven't created the Python 3 disutils package yet. I will try to get that done before the holidays.

    ReplyDelete