Error while importing Geopandas
See original GitHub issueI have installed geopandas using !pip install geopandas. Before installing geopandas I installed gdal and fiona using the same method. But while importing geopandas, following error appears always. How do I rectify it ?
AttributeError Traceback (most recent call last)
<ipython-input-1-fc7d1d298f0c> in <module>
----> 1 import geopandas
~\anaconda3\lib\site-packages\geopandas\__init__.py in <module>
5 from geopandas.array import points_from_xy # noqa
6
----> 7 from geopandas.io.file import _read_file as read_file # noqa
8 from geopandas.io.arrow import _read_parquet as read_parquet # noqa
9 from geopandas.io.arrow import _read_feather as read_feather # noqa
~\anaconda3\lib\site-packages\geopandas\io\file.py in <module>
18
19 try:
---> 20 from fiona import Env as fiona_env
21 except ImportError:
22 try:
~\anaconda3\lib\site-packages\fiona\__init__.py in <module>
86
87 import fiona._loading
---> 88 with fiona._loading.add_gdal_dll_directories():
89 from fiona.collection import BytesCollection, Collection
90 from fiona.drvsupport import supported_drivers
AttributeError: partially initialized module 'fiona' has no attribute '_loading' (most likely due to a circular import)
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Error in importing geopandas - python - Stack Overflow
The problem is caused by incompatibility of the fiona's and gdal's dependencies. Uninstall geopandas via conda. It will uninstall fiona as ...
Read more >Error when importing geopandas · Issue #1756 - GitHub
After successfully installing geopandas, when I import it within jupyter notebooks [Having the most recent python and conda updates) the ...
Read more >Error importing GeoPandas - python - GIS Stack Exchange
Error importing GeoPandas · Just install your required packages at the same time you install geopandas and let conda figure it out, i.e...
Read more >Geopandas - Peter J Wilcoxen - InsightWorks
To make sure everything worked, start spyder and enter "import geopandas" in the console window. If all has gone well, it should quietly...
Read more >Fastest way to install Geopandas in jupyter notebook on ...
First of all, if you will import geopandas without installing it, it will show this error which means we need to install it...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
OK, I can reproduce this by using the environment.yml file from movingpandas, and recreating that environment locally.
But, it seems this is actually an issue with the fiona install, because importing it on itself gives the following error (at least this is the issue for me locally, not 100% sure it’s the same issue on CI):
But, so we are masking this import error message at the moment, and letting geopandas’ import fail because of fiona’s import error (which we don’t want to do, since it’s an optional dependency now).
It seems that https://github.com/geopandas/geopandas/pull/2112 might fix this specific issue (in case that fiona’s install is actually broken)
Glad to report that Travis is happy again: https://app.travis-ci.com/github/anitagraser/movingpandas/builds/238483202