'Pyproj DLL load failed while importing _network

I'm trying to import geopandas in Python. The pyproj module fails to import, with the following error message:

  File ~\.conda\envs\lizard\lib\site-packages\geopandas\_compat.py:9 in <module>
    import pyproj

  File ~\.conda\envs\lizard\lib\site-packages\pyproj\__init__.py:49 in <module>
    import pyproj.network

  File ~\.conda\envs\lizard\lib\site-packages\pyproj\network.py:10 in <module>
    from pyproj._network import (  # noqa: F401 pylint: disable=unused-import

ImportError: DLL load failed while importing _network: The specified module could not be found.

I have installed geopandas with conda install -c conda-forge geopandas. I've tried to conda remove and re-install again, but that does not work. I've tried to reinstall pyproj separately with pip install pyproj and conda install -c conda-forge pyproj but neither have worked. conda update pyproj and geopandas hasn't worked either.

In my environment, pyproj clearly has network.py, _network.cp39-win_amd64.pyd, and _network.pyi, so I'm not sure why the module cannot be found.

ETA: I'm using geopandas 0.10.2 and pyproj 3.3.0.



Solution 1:[1]

Had to abandon conda install entirely and created a new environment which uses pip install to get packages. Followed instructions for pip install geopandas and now it's working.

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 lizard