掌機 - Pandora(Rebirth) - SuperZaxxon - 解決certificate verify failed: unable to get local issuer certificate問題



問題如下:

Collecting matplotlib (from androguard)
  Using cached matplotlib-3.10.8.tar.gz (34.8 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... error
  error: subprocess-exited-with-error
  
  × installing backend dependencies for matplotlib did not run successfully.
  │ exit code: 1
  ╰─> [129 lines of output]
      Collecting ninja>=1.8.2
        Using cached ninja-1.13.0.tar.gz (242 kB)
        Installing build dependencies: started
        Installing build dependencies: finished with status 'done'
        Getting requirements to build wheel: started
        Getting requirements to build wheel: finished with status 'done'
        Installing backend dependencies: started
        Installing backend dependencies: finished with status 'error'
        error: subprocess-exited-with-error
      
        × installing backend dependencies for ninja did not run successfully.
        │ exit code: 1
        ╰─> [112 lines of output]
            Collecting setuptools-scm
              Using cached setuptools_scm-10.0.5-py3-none-any.whl.metadata (6.5 kB)
            Collecting hatch-fancy-pypi-readme>=23.2
              Using cached hatch_fancy_pypi_readme-25.1.0-py3-none-any.whl.metadata (2.0 kB)
            Collecting cmake>=3.15
              Using cached cmake-4.3.1.tar.gz (36 kB)
              Installing build dependencies: started
              Installing build dependencies: finished with status 'done'
              Getting requirements to build wheel: started
              Getting requirements to build wheel: finished with status 'done'
              Preparing metadata (pyproject.toml): started
              Preparing metadata (pyproject.toml): finished with status 'done'
            Collecting vcs-versioning>=1.0.0.dev0 (from setuptools-scm)
              Using cached vcs_versioning-1.1.1-py3-none-any.whl.metadata (1.6 kB)
            Collecting packaging>=20 (from setuptools-scm)
              Using cached packaging-26.1-py3-none-any.whl.metadata (3.5 kB)
            Collecting setuptools (from setuptools-scm)
              Using cached setuptools-82.0.1-py3-none-any.whl.metadata (6.5 kB)
            Collecting hatchling (from hatch-fancy-pypi-readme>=23.2)
              Using cached hatchling-1.29.0-py3-none-any.whl.metadata (3.8 kB)
            Collecting pathspec>=0.10.1 (from hatchling->hatch-fancy-pypi-readme>=23.2)
              Using cached pathspec-1.0.4-py3-none-any.whl.metadata (13 kB)
            Collecting pluggy>=1.0.0 (from hatchling->hatch-fancy-pypi-readme>=23.2)
              Using cached pluggy-1.6.0-py3-none-any.whl.metadata (4.8 kB)
            Collecting trove-classifiers (from hatchling->hatch-fancy-pypi-readme>=23.2)
              Using cached trove_classifiers-2026.1.14.14-py3-none-any.whl.metadata (2.4 kB)
            Using cached setuptools_scm-10.0.5-py3-none-any.whl (21 kB)
            Using cached hatch_fancy_pypi_readme-25.1.0-py3-none-any.whl (10 kB)
            Using cached packaging-26.1-py3-none-any.whl (95 kB)
            Using cached vcs_versioning-1.1.1-py3-none-any.whl (79 kB)
            Using cached hatchling-1.29.0-py3-none-any.whl (76 kB)
            Using cached pathspec-1.0.4-py3-none-any.whl (55 kB)
            Using cached pluggy-1.6.0-py3-none-any.whl (20 kB)
            Using cached setuptools-82.0.1-py3-none-any.whl (1.0 MB)
            Using cached trove_classifiers-2026.1.14.14-py3-none-any.whl (14 kB)
            Building wheels for collected packages: cmake
              Building wheel for cmake (pyproject.toml): started
              Building wheel for cmake (pyproject.toml): finished with status 'error'
              error: subprocess-exited-with-error
      
              × Building wheel for cmake (pyproject.toml) did not run successfully.
              │ exit code: 1
              ╰─> [60 lines of output]
                  Traceback (most recent call last):
                    File "/usr/local/lib/python3.11/urllib/request.py", line 1348, in do_open
                      h.request(req.get_method(), req.selector, req.data, headers,
                    File "/usr/local/lib/python3.11/http/client.py", line 1282, in request
                      self._send_request(method, url, body, headers, encode_chunked)
                    File "/usr/local/lib/python3.11/http/client.py", line 1328, in _send_request
                      self.endheaders(body, encode_chunked=encode_chunked)
                    File "/usr/local/lib/python3.11/http/client.py", line 1277, in endheaders
                      self._send_output(message_body, encode_chunked=encode_chunked)
                    File "/usr/local/lib/python3.11/http/client.py", line 1037, in _send_output
                      self.send(msg)
                    File "/usr/local/lib/python3.11/http/client.py", line 975, in send
                      self.connect()
                    File "/usr/local/lib/python3.11/http/client.py", line 1454, in connect
                      self.sock = self._context.wrap_socket(self.sock,
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    File "/usr/local/lib/python3.11/ssl.py", line 517, in wrap_socket
                      return self.sslsocket_class._create(
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    File "/usr/local/lib/python3.11/ssl.py", line 1075, in _create
                      self.do_handshake()
                    File "/usr/local/lib/python3.11/ssl.py", line 1346, in do_handshake
                      self._sslobj.do_handshake()
                  ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:992)
      
                  During handling of the above exception, another exception occurred:
      
                  Traceback (most recent call last):
                    File "/home/user/.local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
                      main()
                    File "/home/user/.local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
                      json_out["return_val"] = hook(**hook_input["kwargs"])
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    File "/home/user/.local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 280, in build_wheel
                      return _build_backend().build_wheel(
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    File "/tmp/pip-install-ou8ddqf1/cmake_aa395b5dda67445dbbdbfc76b25f6ac4/_build_backend/backend.py", line 156, in build_wheel
                      cmake_path = _bootstrap_build(temp_path, config_settings)
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    File "/tmp/pip-install-ou8ddqf1/cmake_aa395b5dda67445dbbdbfc76b25f6ac4/_build_backend/backend.py", line 103, in _bootstrap_build
                      with urllib.request.urlopen(archive_url) as response:
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    File "/usr/local/lib/python3.11/urllib/request.py", line 216, in urlopen
                      return opener.open(url, data, timeout)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    File "/usr/local/lib/python3.11/urllib/request.py", line 519, in open
                      response = self._open(req, data)
                                 ^^^^^^^^^^^^^^^^^^^^^
                    File "/usr/local/lib/python3.11/urllib/request.py", line 536, in _open
                      result = self._call_chain(self.handle_open, protocol, protocol +
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    File "/usr/local/lib/python3.11/urllib/request.py", line 496, in _call_chain
                      result = func(*args)
                               ^^^^^^^^^^^
                    File "/usr/local/lib/python3.11/urllib/request.py", line 1391, in https_open
                      return self.do_open(http.client.HTTPSConnection, req,
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    File "/usr/local/lib/python3.11/urllib/request.py", line 1351, in do_open
                      raise URLError(err)
                  urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:992)>
                  [end of output]
      
              note: This error originates from a subprocess, and is likely not a problem with pip.
              ERROR: Failed building wheel for cmake
            Failed to build cmake
            error: failed-wheel-build-for-install
      
            × Failed to build installable wheels for some pyproject.toml based projects
            ╰─> cmake
            [end of output]
      
        note: This error originates from a subprocess, and is likely not a problem with pip.
      ERROR: Failed to build 'ninja' when installing backend dependencies for ninja
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed to build 'matplotlib' when installing backend dependencies for matplotlib

解法如下:

$ export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
$ pip3 install matplotlib