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

Simplify or remove script dependencies #178

Closed
tschaub opened this issue Jul 27, 2023 · 3 comments · Fixed by #179
Closed

Simplify or remove script dependencies #178

tschaub opened this issue Jul 27, 2023 · 3 comments · Fixed by #179

Comments

@tschaub
Copy link
Collaborator

tschaub commented Jul 27, 2023

The release procedure currently involves running the Python scripts in the scripts directory to update version numbers in some example data. The scripts readme suggests using Poetry to manage the scripts' dependencies.

I have just followed the instructions on installing Poetry. After changing into the scripts directory and running poetry install, this is what I get from poetry run python generate_example.py:

/Users/tim/Library/Caches/pypoetry/virtualenvs/geoparquet-scripts-pt2NyYug-py3.10/lib/python3.10/site-packages/geopandas/_compat.py:111: UserWarning: The Shapely GEOS version (3.10.3-CAPI-1.16.1) is incompatible with the GEOS version PyGEOS was compiled with (3.10.1-CAPI-1.16.0). Conversions between both will be slow.
  warnings.warn(
Traceback (most recent call last):
  File "/Users/tim/projects/geoparquet/scripts/generate_example.py", line 20, in <module>
    df = geopandas.read_file(geopandas.datasets.get_path("naturalearth_lowres"))
  File "/Users/tim/Library/Caches/pypoetry/virtualenvs/geoparquet-scripts-pt2NyYug-py3.10/lib/python3.10/site-packages/geopandas/io/file.py", line 166, in _read_file
    _check_fiona("'read_file' function")
  File "/Users/tim/Library/Caches/pypoetry/virtualenvs/geoparquet-scripts-pt2NyYug-py3.10/lib/python3.10/site-packages/geopandas/io/file.py", line 80, in _check_fiona
    raise ImportError(
ImportError: the 'read_file' function requires the 'fiona' package, but it is not installed or does not import correctly.
Importing fiona resulted in: dlopen(/Users/tim/Library/Caches/pypoetry/virtualenvs/geoparquet-scripts-pt2NyYug-py3.10/lib/python3.10/site-packages/fiona/ogrext.cpython-310-darwin.so, 0x0002): Library not loaded: /opt/homebrew/opt/gdal/lib/libgdal.31.dylib
  Referenced from: <8EF16756-6EC0-3D20-90D6-ECD7AE37A9E5> /Users/tim/Library/Caches/pypoetry/virtualenvs/geoparquet-scripts-pt2NyYug-py3.10/lib/python3.10/site-packages/fiona/ogrext.cpython-310-darwin.so
  Reason: tried: '/opt/homebrew/opt/gdal/lib/libgdal.31.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/gdal/lib/libgdal.31.dylib' (no such file), '/opt/homebrew/opt/gdal/lib/libgdal.31.dylib' (no such file), '/usr/lib/libgdal.31.dylib' (no such file, not in dyld cache), '/opt/homebrew/Cellar/gdal/3.6.4_4/lib/libgdal.31.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/gdal/3.6.4_4/lib/libgdal.31.dylib' (no such file), '/opt/homebrew/Cellar/gdal/3.6.4_4/lib/libgdal.31.dylib' (no such file), '/usr/lib/libgdal.31.dylib' (no such file, not in dyld cache)
@kylebarron
Copy link
Collaborator

It looks like part of the issue is that the dependencies haven't been touched in a year and some are old and possibly harder to install. Like it looks like the lockfile is bringing in pyarrow==7.0 and that doesn't have a wheel for Python 3.11 (that's the error I'm hitting)

@tschaub
Copy link
Collaborator Author

tschaub commented Jul 27, 2023

In an effort to get though this, I tried poetry update. After that, this is the result of poetry run python generate_example.py:

/Users/tim/Library/Caches/pypoetry/virtualenvs/geoparquet-scripts-pt2NyYug-py3.10/lib/python3.10/site-packages/geopandas/_compat.py:111: UserWarning: The Shapely GEOS version (3.11.1-CAPI-1.17.1) is incompatible with the GEOS version PyGEOS was compiled with (3.10.1-CAPI-1.16.0). Conversions between both will be slow.
  warnings.warn(
Traceback (most recent call last):
  File "/Users/tim/projects/geoparquet/scripts/generate_example.py", line 21, in <module>
    df = df.to_crs("crs84")
  File "/Users/tim/Library/Caches/pypoetry/virtualenvs/geoparquet-scripts-pt2NyYug-py3.10/lib/python3.10/site-packages/geopandas/geodataframe.py", line 1275, in to_crs
    geom = df.geometry.to_crs(crs=crs, epsg=epsg)
  File "/Users/tim/Library/Caches/pypoetry/virtualenvs/geoparquet-scripts-pt2NyYug-py3.10/lib/python3.10/site-packages/geopandas/geoseries.py", line 1120, in to_crs
    self.values.to_crs(crs=crs, epsg=epsg), index=self.index, name=self.name
  File "/Users/tim/Library/Caches/pypoetry/virtualenvs/geoparquet-scripts-pt2NyYug-py3.10/lib/python3.10/site-packages/geopandas/array.py", line 768, in to_crs
    crs = CRS.from_user_input(crs)
  File "/Users/tim/Library/Caches/pypoetry/virtualenvs/geoparquet-scripts-pt2NyYug-py3.10/lib/python3.10/site-packages/pyproj/crs/crs.py", line 501, in from_user_input
    return cls(value, **kwargs)
  File "/Users/tim/Library/Caches/pypoetry/virtualenvs/geoparquet-scripts-pt2NyYug-py3.10/lib/python3.10/site-packages/pyproj/crs/crs.py", line 348, in __init__
    self._local.crs = _CRS(self.srs)
  File "pyproj/_crs.pyx", line 2366, in pyproj._crs._CRS.__init__
pyproj.exceptions.CRSError: Invalid projection: crs84: (Internal Proj Error: proj_create: unrecognized format / unknown name)

@kylebarron
Copy link
Collaborator

I made #179. I think the crs84 is supposed to be "ogc:84"

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

Successfully merging a pull request may close this issue.

2 participants