failed to install python-gerrit in mac

Viewed 10

environment description:

❯ python3 -V
Python 3.10.6
❯ 
❯ sw_vers -productVersion;system_profiler SPSoftwareDataType
12.5
Software:

    System Software Overview:

      System Version: macOS 12.5 (21G72)
      Kernel Version: Darwin 21.6.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      User Name: Xiaojue Guan (xiaojueguan)
      Secure Virtual Memory: Enabled
      System Integrity Protection: Enabled
      Time since boot: 6 days 20:12

problem

pip3 install python-gerrit

above command failed with error log like

  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [16 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 14, in <module>
        File "/private/var/folders/7l/j4wk0w0n6bg3rgljkxxgqpdc0000gn/T/pip-install-rf0int5e/distribute_1ec995ad2575426aad1cf57a4706aba9/setuptools/__init__.py", line 2, in <module>
          from setuptools.extension import Extension, Library
        File "/private/var/folders/7l/j4wk0w0n6bg3rgljkxxgqpdc0000gn/T/pip-install-rf0int5e/distribute_1ec995ad2575426aad1cf57a4706aba9/setuptools/extension.py", line 5, in <module>
          from setuptools.dist import _get_unpatched
        File "/private/var/folders/7l/j4wk0w0n6bg3rgljkxxgqpdc0000gn/T/pip-install-rf0int5e/distribute_1ec995ad2575426aad1cf57a4706aba9/setuptools/dist.py", line 7, in <module>
          from setuptools.command.install import install
        File "/private/var/folders/7l/j4wk0w0n6bg3rgljkxxgqpdc0000gn/T/pip-install-rf0int5e/distribute_1ec995ad2575426aad1cf57a4706aba9/setuptools/command/__init__.py", line 8, in <module>
          from setuptools.command import install_scripts
        File "/private/var/folders/7l/j4wk0w0n6bg3rgljkxxgqpdc0000gn/T/pip-install-rf0int5e/distribute_1ec995ad2575426aad1cf57a4706aba9/setuptools/command/install_scripts.py", line 3, in <module>
          from pkg_resources import Distribution, PathMetadata, ensure_directory
        File "/private/var/folders/7l/j4wk0w0n6bg3rgljkxxgqpdc0000gn/T/pip-install-rf0int5e/distribute_1ec995ad2575426aad1cf57a4706aba9/pkg_resources.py", line 1518, in <module>
          register_loader_type(importlib_bootstrap.SourceFileLoader, DefaultProvider)
      AttributeError: module 'importlib._bootstrap' has no attribute 'SourceFileLoader'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Things i tried

  1. update the version setuptools with below command, but no luck
python3 -m pip install --upgrade setuptools

my guesses

  1. Is the problem related with the permission control of mac os?

help need on

  1. how to solve this problem?
  2. Any way to gather more info related with this problem?
0 Answers
Related