简体   繁体   中英

pyproj - ImportError: cannot import name '_datadir'

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?

I have the same problem. and solve after installing proj

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM