'pip install geopandas on windows
I am relatively new to python and trying to install geopandas on python 3.7 using pip. For separate reasons, I would like to avoid using the anaconda distribution. Following this post, I was able to successfully install geopandas by first installing the dependencies manually. The problem is that now I run into a problem when I try to import geopandas:
import geopandas
The subsequent error message is:
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\geopandas\__init__.py", line 5, in <module>
from geopandas.io.file import read_file
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\geopandas\io\file.py", line 4, in <module>
import fiona
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\fiona\__init__.py", line 87, in <module>
from fiona.collection import BytesCollection, Collection
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\fiona\collection.py", line 9, in <module>
from fiona.ogrext import Iterator, ItemsIterator, KeysIterator
ImportError: DLL load failed: The specified module could not be found.
Any advice would be greatly appreciated
Solution 1:[1]
My case is similar to yours. And here is how I got mine setup:
Platform: Windows 10, 64-bit Python Version: Python 3.7
Dependencies (whl files needed):
- GDAL?3.0.4?cp37?cp37m?win_amd64.whl
- Fiona?1.8.13?cp37?cp37m?win_amd64.whl
- pyproj?2.6.0?cp37?cp37m?win_amd64.whl
- Rtree?0.9.4?cp37?cp37m?win_amd64.whl
Steps:
Download the files that match the platform and Python version from
Install packages (stick with the order)
a) C:\Users...\Python37\Scripts>pip3.7 install C:...\GDAL?3.0.4?cp37?cp37m?win_amd64.whl
b) C:\Users...\Python37\Scripts>pip3.7 install C:...\Fiona?1.8.13?cp37?cp37m?win_amd64.whl
c) C:\Users...\Python37\Scripts>pip3.7 install C:...\pyproj?2.6.0?cp37?cp37m?win_amd64.whl
d) C:\Users...\Python37\Scripts>pip3.7 install C:...\Rtree?0.9.4?cp37?cp37m?win_amd64.whl
- Given no errros, now it's good to go:
C:\Users...\Python37\Scripts>pip3.7.exe install geopandas
Test it using IDEL 3.7.4
import geopandas as pdg
(It works!)
This works for me and I hope this is also helpful for you.
Solution 2:[2]
I had trouble installing geopandas on (win-64, Spyder3.8, Python3.8.3) Use this expression to install geopandas in anaconda prompt: conda install -c conda-forge/label/cf202003 geos (do not use this website: https://geopandas.org/install.html) (do not use this expression: conda install --channel conda-forge geopandas)
Solution 3:[3]
The simplest method to install geopandas is:
conda install geopandas
In order to update geopandas to latest version use the following command after installation by conda:
pip install geopandas --upgrade
There are other installation methods also explained in Geopandas official website.
Conda is really powerful when it comes to installation as it will install the dependencies needed by the package. However, if you would like to install dependencies earlier than use the following command:
conda install pandas fiona shapely pyproj rtree descartes
Note that if you have installed the dependencies using above command then you can also use
pipto installgeopandasbut before installing via pip dependencies are required to be installed. In order to read more about dependencies, please follow the official guide. To install usingpipuse the following command:
pip install geopandas
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Harry |
| Solution 2 | Ali Mohammadinia |
| Solution 3 |
