【问题标题】:When importing Cartopy ImportError: DLL load failed while importing trace: The specified module could not be found导入 Cartopy 时 ImportError: DLL load failed while importing trace: 找不到指定的模块
【发布时间】:2022-06-26 21:32:40
【问题描述】:

我在一个活跃的虚拟环境中使用 pip 安装了Christoph Gohlke 的预构建轮子Cartopy‑0.20.2‑cp39‑cp39‑win_amd64.whl。环境使用 Python 3.9.5。尝试导入 Cartopy 时,我收到以下错误消息。这曾经有效,现在不再有效,我不知道为什么。有谁知道问题可能是什么或我错过了什么?

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Input In [4], in <cell line: 1>()
----> 1 import cartopy
      2 import cartopy.crs as ccrs
      3 import cartopy.io.img_tiles as cimgt

File ~\Downloads\GitHub\Project\venv\lib\site-packages\cartopy\__init__.py:110, in <module>
    105     pass
    108 # Commonly used sub-modules. Imported here to provide end-user
    109 # convenience.
--> 110 import cartopy.crs
    111 import cartopy.feature

File ~\Downloads\GitHub\Project\venv\lib\site-packages\cartopy\crs.py:27, in <module>
     24 from pyproj.exceptions import ProjError
     25 from shapely.prepared import prep
---> 27 import cartopy.trace
     30 try:
     31     # https://github.com/pyproj4/pyproj/pull/912
     32     from pyproj.crs import CustomConstructorCRS as _CRS

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

【问题讨论】:

  • 从同一站点安装 shapely 和 pyproj。
  • 我通过 pip 安装了相同的 shapely 和 pyproj 版本,但是当我使用 --force-reinstall 时,它起作用了。

标签: python cartopy


【解决方案1】:

As mentioned by cgohlke 在 cmets 中,从他的网站安装 shapely 和 pyproj 的轮子解决了这个问题。

如果库已安装,请使用--force-reinstall 覆盖现有安装。

【讨论】:

    猜你喜欢
    • 2020-03-28
    • 1970-01-01
    • 2020-12-04
    • 2020-07-02
    • 2020-06-30
    • 2015-12-16
    • 2019-08-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多