0

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.

lizard
  • 123
  • 2
  • 7
  • Could you please show the installed versions of `geopandas` and `pyproj`? Just type `geopandas.__version__` and `pyproj.__version__` in python interpreter. – Dima Chubarov Apr 11 '22 at 15:27
  • Geopandas 0.10.2 and Pyproj 3.3.0 – lizard Apr 11 '22 at 16:02
  • There is an [issue on pyproj github](https://github.com/pyproj4/pyproj/issues/770) that looks similar to your experience. There the solution was to install [Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019](https://support.microsoft.com/en-us/topic/the-latest-supported-visual-c-downloads-2647da03-1eea-4433-9aff-95f26a218cc0). – Dima Chubarov Apr 12 '22 at 15:16
  • Thanks for this, I've seen this too. I was hoping there would be a more direct solution within Anaconda. – lizard Apr 13 '22 at 10:49

1 Answers1

0

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.

lizard
  • 123
  • 2
  • 7