holoviz / geoviews

Simple, concise geographical visualization in Python
http://geoviews.org
BSD 3-Clause "New" or "Revised" License
587 stars 75 forks source link

can't import geoviews in Python 3.5 #82

Closed eldobbins closed 5 years ago

eldobbins commented 7 years ago

I am trying to use geoviews in Mac OS X 10.7.5. Because of this elderly OS, I have to use Anaconda 4.2 and Python 3.5 rather than the most recent versions. Installing geoviews goes fine, but I can't use it. Here's the error:

(py35) ELD-MacBook-Pro:Desktop EDobbins$ conda install -c conda-forge -c ioam holoviews geoviews
Fetching package metadata .............
Solving package specifications: .

Package plan for installation in environment /Users/EDobbins/anaconda2/envs/py35:

The following NEW packages will be INSTALLED:

    cartopy:   0.15.1-np111py35_2 conda-forge
    geos:      3.5.1-1            conda-forge
    geoviews:  1.3.0-py35_0       ioam       
    holoviews: 1.8.1-py35_0       conda-forge
    lancet:    0.9.0-py35_0       conda-forge
    owslib:    0.14.0-py35_0      conda-forge
    param:     1.5.1-py35_0       conda-forge
    proj4:     4.9.3-4            conda-forge
    pyepsg:    0.3.2-py35_0       conda-forge
    pyproj:    1.9.5.1-py35_0     conda-forge
    pyshp:     1.2.11-py35_0      conda-forge
    shapely:   1.5.17-py35_4      conda-forge

Proceed ([y]/n)? y

param-1.5.1-py 100% |#############################################################| Time: 0:00:00 247.38 kB/s
lancet-0.9.0-p 100% |#############################################################| Time: 0:00:00 182.13 kB/s
holoviews-1.8. 100% |#############################################################| Time: 0:00:02   1.67 MB/s
(py35) ELD-MacBook-Pro:Desktop EDobbins$ python
Python 3.5.2 |Anaconda 4.2.0 (x86_64)| (default, Jul  2 2016, 17:52:12) 
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>  import geoviews

ParseException: Unexpected EOF parsing WKB
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/EDobbins/anaconda2/envs/py35/lib/python3.5/site-packages/geoviews/__init__.py", line 9, in <module>
    from .element import (_Element, Feature, Tiles,     # noqa (API import)
  File "/Users/EDobbins/anaconda2/envs/py35/lib/python3.5/site-packages/geoviews/element/__init__.py", line 3, in <module>
    from .geo import (_Element, Feature, Tiles, is_geographic,     # noqa (API import)
  File "/Users/EDobbins/anaconda2/envs/py35/lib/python3.5/site-packages/geoviews/element/geo.py", line 3, in <module>
    from cartopy import crs as ccrs
  File "/Users/EDobbins/anaconda2/envs/py35/lib/python3.5/site-packages/cartopy/__init__.py", line 24, in <module>
    import shapely.speedups
  File "/Users/EDobbins/anaconda2/envs/py35/lib/python3.5/site-packages/shapely/speedups/__init__.py", line 3, in <module>
    from shapely.geometry import linestring, polygon
  File "/Users/EDobbins/anaconda2/envs/py35/lib/python3.5/site-packages/shapely/geometry/__init__.py", line 4, in <module>
    from .base import CAP_STYLE, JOIN_STYLE
  File "/Users/EDobbins/anaconda2/envs/py35/lib/python3.5/site-packages/shapely/geometry/base.py", line 169, in <module>
    EMPTY = deserialize_wkb(a2b_hex(b'010700000000000000'))
  File "/Users/EDobbins/anaconda2/envs/py35/lib/python3.5/site-packages/shapely/geometry/base.py", line 110, in deserialize_wkb
    "Could not create geometry because of errors while reading input.")
shapely.geos.ReadingError: Could not create geometry because of errors while reading input.

Do I have any options here? Is this a known error that can be fixed?

Thanks for any hints.

philippjfr commented 7 years ago

Looks like an error in shapely. Maybe try installing an earlier version? We'll have to pin a particular version if this remains an issue.

eldobbins commented 7 years ago

Based on that idea, I tried a whole bunch shapely 1.4 and 1.5.0 - nope cause needs python2.7 1.5.16 and 1.5.15 installed OK but didn't solve the problem. 1.5.14 I haven't been able to find: "Package missing in current osx-64 channels" 1.5.13 downgraded a bunch of other packages while installing, and ended up with a different error message regarding pandas.

Obvious solution would be to upgrade the whole system. But I'm willing to try other ideas.

philippjfr commented 5 years ago

This is not an issue with geoviews itself but rather upstream dependencies. conda-forge is standardizing on the same compiler setup as the defaults channel this week so it should now be easier to ensure you get a compatible set of libraries.