5

After I installed pyproj and geopandas I get an error when importing the latter:

!conda install --offline -c conda-forge geopandas-0.7.0-py_1.tar.bz2
!conda install --offline -c conda-forge pyproj-2.6.0-py38hff69d4a_0.tar.bz2
import geopandas

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-8-f30f80f43dee> in <module>()
      1 # from pyproj import _datadir, datadir
----> 2 import geopandas

~\AppData\Local\Continuum\anaconda3\lib\site-packages\geopandas\__init__.py in <module>()
----> 1 from geopandas.geoseries import GeoSeries  # noqa
      2 from geopandas.geodataframe import GeoDataFrame  # noqa
      3 from geopandas.array import _points_from_xy as points_from_xy  # noqa
      4 
      5 from geopandas.io.file import read_file  # noqa

~\AppData\Local\Continuum\anaconda3\lib\site-packages\geopandas\geoseries.py in <module>()
      7 from pandas.core.internals import SingleBlockManager
      8 
----> 9 from pyproj import CRS, Transformer
     10 from shapely.geometry.base import BaseGeometry
     11 from shapely.ops import transform

~\AppData\Local\Continuum\anaconda3\lib\site-packages\pyproj\__init__.py in <module>()
     49 import warnings
     50 
---> 51 from pyproj import _datadir
     52 from pyproj._list import (  # noqa: F401
     53     get_angular_units_map,

ImportError: cannot import name '_datadir'

I tried with this answer I get error "No module named 'pyproj._datadir'" after I made .py to .exe with pyinstaller but no success:

from pyproj import _datadir, datadir
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-9-93608890c27f> in <module>()
----> 1 from pyproj import _datadir, datadir
      2 # import geopandas

~\AppData\Local\Continuum\anaconda3\lib\site-packages\pyproj\__init__.py in <module>()
     49 import warnings
     50 
---> 51 from pyproj import _datadir
     52 from pyproj._list import (  # noqa: F401
     53     get_angular_units_map,

ImportError: cannot import name '_datadir'

I am using Windows 8.1 and

conda version : 4.5.4
conda-build version : 3.10.5
python version : 3.6.5.final.0

Is there any solution/workaround?

Ale
  • 917
  • 9
  • 28

1 Answers1

0

I have the same problem. and solve after installing proj

conda install --offline proj-7.2.0-he47e99f_1.tar.bz2

  • Thank you for your answer. I can't verify it now but I will keep it in mind. – Ale Dec 23 '20 at 16:29
  • I tried just now: I've installed `proj 7.2.1` but then when I import it `import proj` I get `ModuleNotFoundError: No module named 'proj'` – Ale Feb 02 '21 at 11:26
  • I tried also `from pyproj import Proj` but I still get `ImportError: cannot import name '_datadir'`. – Ale Feb 02 '21 at 11:31