首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >安装cartopy时遇到问题-用于工作

安装cartopy时遇到问题-用于工作
EN

Stack Overflow用户
提问于 2020-04-22 01:57:03
回答 1查看 1.8K关注 0票数 0

我曾经在我的MAC上安装了Cartopy。当我执行"pip3 install metpy“时,它被metpy拖了进来。我最近不得不重新安装,而metpy并没有把它拖进来。现在我在安装cartopy时遇到错误:

代码语言:javascript
运行
复制
> pip3 install cartopy
Collecting cartopy
  Using cached Cartopy-0.17.0.tar.gz (8.9 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Processing /Users/lroot/Library/Caches/pip/wheels/a6/0c/de/321b5192ad416b328975a2f0385f72c64db4656501eba7cc1a/pyshp-2.1.0-cp37-none-any.whl
Collecting shapely>=1.5.6
  Using cached Shapely-1.7.0-cp37-cp37m-macosx_10_9_x86_64.whl (1.6 MB)
Requirement already satisfied: six>=1.3.0 in /usr/local/lib/python3.7/site-packages (from cartopy) (1.14.0)
Requirement already satisfied: numpy>=1.10 in /usr/local/lib/python3.7/site-packages (from cartopy) (1.18.1)
Requirement already satisfied: setuptools>=0.7.2 in /Users/lroot/Library/Python/3.7/lib/python/site-packages (from cartopy) (45.0.0)
Building wheels for collected packages: cartopy
  Building wheel for cartopy (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/local/opt/python/bin/python3.7 /usr/local/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpnpafqiiy
       cwd: /private/tmp/pip-install-0phmeb7k/cartopy
  Complete output (270 lines):

跟踪的相关结尾为:

代码语言:javascript
运行
复制
   In file included from lib/cartopy/trace.cpp:614:
  /usr/local/Cellar/proj/7.0.0/include/proj_api.h:37:2: error: 'To use the proj_api.h you must define the macro ACCEPT_USE_OF_DEPRECATED_PROJ_API_H'
  #error 'To use the proj_api.h you must define the macro ACCEPT_USE_OF_DEPRECATED_PROJ_API_H'
   ^
  In file included from lib/cartopy/trace.cpp:615:
  In file included from ./lib/cartopy/_trace.h:27:
  /usr/local/Cellar/proj/7.0.0/include/proj_api.h:37:2: error: 'To use the proj_api.h you must define the macro ACCEPT_USE_OF_DEPRECATED_PROJ_API_H'
  #error 'To use the proj_api.h you must define the macro ACCEPT_USE_OF_DEPRECATED_PROJ_API_H'
   ^
  2 errors generated.
  /private/tmp/pip-build-env-jk86sm4x/overlay/lib/python3.7/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /private/tmp/pip-install-0phmeb7k/cartopy/lib/cartopy/trace.pyx
    tree = Parsing.p_module(s, pxd, full_module_name)
  /private/tmp/pip-build-env-jk86sm4x/overlay/lib/python3.7/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /private/tmp/pip-install-0phmeb7k/cartopy/lib/cartopy/_crs.pxd
    tree = Parsing.p_module(s, pxd, full_module_name)
  warning: lib/cartopy/_crs.pyx:39:4: 'projPJ' redeclared
  /private/tmp/pip-build-env-jk86sm4x/overlay/lib/python3.7/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /private/tmp/pip-install-0phmeb7k/cartopy/lib/cartopy/geodesic/_geodesic.pyx
    tree = Parsing.p_module(s, pxd, full_module_name)
  error: command 'clang' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for cartopy
Failed to build cartopy
ERROR: Could not build wheels for cartopy which use PEP 517 and cannot be installed directly

Proj 7.0是brew将安装的最新版本。为什么它会被弃用?为什么cartopy使用不推荐使用的库?

EN

回答 1

Stack Overflow用户

发布于 2020-04-22 02:16:47

这是一种解决方法

https://github.com/SciTools/cartopy/issues/1288

将项目降级至5.2.0。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61349982

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档