Unable to import linestring and polygon shapefile
See original GitHub issueHi, I tried to use GeoPandas to import linestring and polygon data using Jupyter lab. However, every time I run the code, my kernel died and python quit unexpectedly. It does not even work with the example data.
import geopandas as gpd
path = gpd.datasets.get_path('nybb')
gdf = gpd.read_file(path)
The thing is when I loaded point data, there is no problem at all, only line and polygon data.
I tried to import the same line and polygon using fiona and gdal. They all worked very well. There is also no problem when I load the data in using terminal python, QGIS, and R.
I tried to uninstall and then reinstall GeoPandas, anaconda. None of them worked. This is really weird. I cannot think of any reasons why this happens. I have been struggling for two days. Can someone help me?
Python 3.7.4 macOS Catalina version 10.15.1 (19B88)
edited by @martinfleis to include whole affected code
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
I would say that is the actual cause of this. As you have installed geopandas and its dependencies using PIP, you have to make sure yourself that all dependencies (especially those relying on C like Fiona) are compatible. I would recommend trying new environment and installing everything using conda from conda-forge as is outlined in our documentation. Would that be possible?
In this case it is hard to help as we are unable to replicate the issue. I even tried to install everything using pip and I am still unable to reproduce it. Looking into the code, I have no clue what should cause this, especially if points are okay.
@martinfleis It works! I did what you suggested. Created a new conda environmental in anaconda3 and installed a ipykernel in it. Now everything works like a charm. No problem importing line or polygon data. Thank you so much for your help! 😃