Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shapely version #27

Open
RichardScottOZ opened this issue May 18, 2023 · 1 comment
Open

shapely version #27

RichardScottOZ opened this issue May 18, 2023 · 1 comment

Comments

@RichardScottOZ
Copy link

RichardScottOZ commented May 18, 2023

Do you know what version you were running when this was set up?

ImportError                               Traceback (most recent call last)
Cell In[10], line 4
      2 import netCDF4
      3 import numpy as np
----> 4 from geophys_utils import NetCDFLineUtils
      5 import matplotlib.pyplot as plt
      6 from geophys_utils import array2file

File ~\AppData\Local\miniconda3\envs\pangeo3\lib\site-packages\geophys_utils\__init__.py:41
     29 #===============================================================================
     30 # if not logger.handlers:
     31 #     # Set handler for root logger to standard output
   (...)
     37 #     logger.addHandler(console_handler)
     38 #===============================================================================
     40 from geophys_utils._netcdf_utils import NetCDFUtils
---> 41 from geophys_utils._netcdf_grid_utils import NetCDFGridUtils
     42 from geophys_utils._netcdf_point_utils import NetCDFPointUtils
     43 from geophys_utils._netcdf_line_utils import NetCDFLineUtils

File ~\AppData\Local\miniconda3\envs\pangeo3\lib\site-packages\geophys_utils\_netcdf_grid_utils.py:30
     28 from geophys_utils._polygon_utils import netcdf2convex_hull
     29 from geophys_utils._netcdf_utils import NetCDFUtils, METADATA_CRS
---> 30 from shapely.geometry import Polygon, MultiPolygon, asPolygon
     31 from shapely.geometry.base import BaseGeometry
     32 import shapely

ImportError: cannot import name 'asPolygon' from 'shapely.geometry' 
@asedgmen
Copy link

I have an old installation of anaconda on my PC with shapely version 1.7.1, which works with the geophys_utils. I recently came across the 'asPolygon' error with a fresh installation of python and geophys_utils on Linux, having installed the required modules using the requirements.txt. This loaded the latest version of the shapely module, 2.0.1. I found uninstalling the latest module and installing 1.7.1 solved the issue for me:

pip uninstall shapely
pip install shapely==1.7.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants