Brewでpython@3.9と他のsite-
packageをインストールし、pipでcartopyをインストールしようとしていました。バージョンも確認していましたが、pip
installするときどうしてもうまくいきませんでした。エラーの内容以下になります。解決策をご存知の方がおられましたら、是非教えていただければと存じます。

```

    >Collecting cartopy
      Using cached Cartopy-0.20.1.tar.gz (10.8 MB)
      Installing build dependencies ... done
      Getting requirements to build wheel ... error
      ERROR: Command errored out with exit status 1:
       command: /opt/homebrew/opt/python@3.9/bin/python3.9 /opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /var/folders/yw/r71bkb_n1ml4y0wpx_h9pzd00000gn/T/tmp5z46lu6h
           cwd: /private/var/folders/yw/r71bkb_n1ml4y0wpx_h9pzd00000gn/T/pip-install-4umjbxq_/cartopy_a90c6a6e44a942b199df64668dbc0d7b
      Complete output (34 lines):
      Traceback (most recent call last):
        File "/opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/opt/homebrew/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/build_meta.py", line 154, in get_requires_for_build_wheel
          return self._get_build_requires(
        File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/build_meta.py", line 135, in _get_build_requires
          self.run_setup()
        File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/build_meta.py", line 150, in run_setup
          exec(compile(code, __file__, 'exec'), locals())
        File "setup.py", line 326, in <module>
          setup(
        File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/__init__.py", line 159, in setup
          return distutils.core.setup(**attrs)
        File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/core.py", line 108, in setup
          _setup_distribution = dist = klass(attrs)
        File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/dist.py", line 453, in __init__
          _Distribution.__init__(
        File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 292, in __init__
          self.finalize_options()
        File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/dist.py", line 830, in finalize_options
          for ep in sorted(loaded, key=by_order):
        File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/setuptools/dist.py", line 829, in <lambda>
          loaded = map(lambda e: e.load(), filtered)
        File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pkg_resources/__init__.py", line 2454, in load
          self.require(*args, **kwargs)
        File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pkg_resources/__init__.py", line 2477, in require
          items = working_set.resolve(reqs, env, installer, extras=self.extras)
        File "/opt/homebrew/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pkg_resources/__init__.py", line 782, in resolve
          raise VersionConflict(dist, req).with_context(dependent_req)
      pkg_resources.ContextualVersionConflict: (pyparsing 3.0.4 (/opt/homebrew/lib/python3.9/site-packages), Requirement.parse('pyparsing<3,>=2.0.2'), {'packaging'})
    
```
CC BY-SA 4.0
2021-11-01T14:15:50.970
83379
2022-08-11T10:04:11.817
2021-11-01T16:31:41.963
3060
48907
question
python python3 macos pip
Pipでcartopyインストールエラーについて
Anaconda の場合これで修復しました。

```

    conda install -c conda-forge cartopy
    
```
CC BY-SA 4.0
2022-08-11T07:36:22.877
90506
2022-08-11T10:04:11.817
2022-08-11T10:04:11.817
3060
53956
83379
answer