gpt4 book ai didi

python - pyproj - 导入错误 : cannot import name '_datadir'

转载 作者:行者123 更新时间:2023-12-03 20:56:23 31 4
gpt4 key购买 nike

安装 pyprojgeopandas 后,导入后者时出现错误:

!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 get error "No module named 'pyproj._datadir'" after I made .py to .exe with pyinstaller 但没有成功:
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'

我使用的是 Windows 8.1 和
conda version : 4.5.4
conda-build version : 3.10.5
python version : 3.6.5.final.0

是否有任何解决方案/解决方法?

最佳答案

我也有同样的问题。并在安装项目后解决

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

关于python - pyproj - 导入错误 : cannot import name '_datadir' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60848508/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com