Cannot install Meshtastic Python API on Macbook Air M1 (fails to install pygatt)

I’m trying to install Meshtastic Python API on Macbook Air M1 (2020), without success.
Installation fails on pygatt.
Here is console output.

% pip install --upgrade pip pygatt pytap2 wheel mesthtastic
Requirement already satisfied: pip in /Users/tekk/.platformio/penv/lib/python3.9/site-packages (21.2.4)
Collecting pip
  Using cached pip-21.3-py3-none-any.whl (1.7 MB)
Collecting pygatt
  Using cached pygatt-4.0.5.tar.gz (40 kB)
Collecting pytap2
  Using cached pytap2-2.1.0-py3-none-any.whl (5.5 kB)
Requirement already satisfied: wheel in /Users/tekk/.platformio/penv/lib/python3.9/site-packages (0.37.0)
ERROR: Could not find a version that satisfies the requirement mesthtastic (from versions: none)
ERROR: No matching distribution found for mesthtastic
WARNING: You are using pip version 21.2.4; however, version 21.3 is available.
You should consider upgrading via the '/Users/tekk/.platformio/penv/bin/python -m pip install --upgrade pip' command.
tekk@AiruzivtelaTekk firmware-1.2.45.b674054 % pip3 install --upgrade pip pygatt pytap2 wheel mesthtastic
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pip in /Users/tekk/Library/Python/3.8/lib/python/site-packages (21.3)
Collecting pygatt
  Using cached pygatt-4.0.5.tar.gz (40 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: pytap2 in /Users/tekk/Library/Python/3.8/lib/python/site-packages (2.1.0)
Requirement already satisfied: wheel in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages (0.33.1)
Collecting wheel
  Using cached wheel-0.37.0-py2.py3-none-any.whl (35 kB)
ERROR: Could not find a version that satisfies the requirement mesthtastic (from versions: none)
ERROR: No matching distribution found for mesthtastic
tekk@AiruzivtelaTekk firmware-1.2.45.b674054 % pip3 install --upgrade pip pytap2 wheel mesthtastic
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pip in /Users/tekk/Library/Python/3.8/lib/python/site-packages (21.3)
Requirement already satisfied: pytap2 in /Users/tekk/Library/Python/3.8/lib/python/site-packages (2.1.0)
Requirement already satisfied: wheel in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages (0.33.1)
Collecting wheel
  Using cached wheel-0.37.0-py2.py3-none-any.whl (35 kB)
tekk@AiruzivtelaTekk firmware-1.2.45.b674054 % pip3 install --upgrade meshtastic      
Defaulting to user installation because normal site-packages is not writeable
Collecting meshtastic
  Using cached meshtastic-1.2.40-py3-none-any.whl (63 kB)
Requirement already satisfied: pyserial>=3.4 in /Users/tekk/Library/Python/3.8/lib/python/site-packages (from meshtastic) (3.5)
Requirement already satisfied: pyqrcode>=1.2.1 in /Users/tekk/Library/Python/3.8/lib/python/site-packages (from meshtastic) (1.2.1)
Requirement already satisfied: tabulate>=0.8.9 in /Users/tekk/Library/Python/3.8/lib/python/site-packages (from meshtastic) (0.8.9)
Requirement already satisfied: pypubsub>=4.0.3 in /Users/tekk/Library/Python/3.8/lib/python/site-packages (from meshtastic) (4.0.3)
Requirement already satisfied: dotmap>=1.3.14 in /Users/tekk/Library/Python/3.8/lib/python/site-packages (from meshtastic) (1.3.24)
Requirement already satisfied: protobuf>=3.13.0 in /Users/tekk/Library/Python/3.8/lib/python/site-packages (from meshtastic) (3.18.1)
Collecting pygatt>=4.0.5
  Using cached pygatt-4.0.5.tar.gz (40 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: timeago>=1.0.15 in /Users/tekk/Library/Python/3.8/lib/python/site-packages (from meshtastic) (1.0.15)
Requirement already satisfied: pexpect>=4.6.0 in /Users/tekk/Library/Python/3.8/lib/python/site-packages (from meshtastic) (4.8.0)
Requirement already satisfied: ptyprocess>=0.5 in /Users/tekk/Library/Python/3.8/lib/python/site-packages (from pexpect>=4.6.0->meshtastic) (0.7.0)
Requirement already satisfied: enum-compat in /Users/tekk/Library/Python/3.8/lib/python/site-packages (from pygatt>=4.0.5->meshtastic) (0.0.3)
Building wheels for collected packages: pygatt
  Building wheel for pygatt (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Library/Developer/CommandLineTools/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/kq/y336n3157pd60bz9gn39jyxr0000gn/T/pip-install-i1dmgg0t/pygatt_f414e8b0bd494db6b2e2a4233e9bc8f4/setup.py'"'"'; __file__='"'"'/private/var/folders/kq/y336n3157pd60bz9gn39jyxr0000gn/T/pip-install-i1dmgg0t/pygatt_f414e8b0bd494db6b2e2a4233e9bc8f4/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/kq/y336n3157pd60bz9gn39jyxr0000gn/T/pip-wheel-0zysg846
       cwd: /private/var/folders/kq/y336n3157pd60bz9gn39jyxr0000gn/T/pip-install-i1dmgg0t/pygatt_f414e8b0bd494db6b2e2a4233e9bc8f4/
  Complete output (27 lines):
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/private/var/folders/kq/y336n3157pd60bz9gn39jyxr0000gn/T/pip-install-i1dmgg0t/pygatt_f414e8b0bd494db6b2e2a4233e9bc8f4/setup.py", line 16, in <module>
      setup(
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/__init__.py", line 164, in setup
      _install_setup_requires(attrs)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/__init__.py", line 159, in _install_setup_requires
      dist.fetch_build_eggs(dist.setup_requires)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/dist.py", line 699, in fetch_build_eggs
      resolved_dists = pkg_resources.working_set.resolve(
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 779, in resolve
      dist = best[req.key] = env.best_match(
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1064, in best_match
      return self.obtain(req, installer)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1076, in obtain
      return installer(requirement)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/dist.py", line 758, in fetch_build_egg
      return fetch_build_egg(self, req)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/installer.py", line 133, in fetch_build_egg
      wheel.install_as_egg(dist_location)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/wheel.py", line 99, in install_as_egg
      self._install_as_egg(destination_eggdir, zf)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/wheel.py", line 107, in _install_as_egg
      self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/wheel.py", line 128, in _convert_metadata
      os.mkdir(destination_eggdir)
  FileExistsError: [Errno 17] File exists: '/private/var/folders/kq/y336n3157pd60bz9gn39jyxr0000gn/T/pip-install-i1dmgg0t/pygatt_f414e8b0bd494db6b2e2a4233e9bc8f4/.eggs/coverage-6.0.2-py3.8-macosx-10.14-arm64.egg'
  ----------------------------------------
  ERROR: Failed building wheel for pygatt
  Running setup.py clean for pygatt
  ERROR: Command errored out with exit status 1:
   command: /Library/Developer/CommandLineTools/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/kq/y336n3157pd60bz9gn39jyxr0000gn/T/pip-install-i1dmgg0t/pygatt_f414e8b0bd494db6b2e2a4233e9bc8f4/setup.py'"'"'; __file__='"'"'/private/var/folders/kq/y336n3157pd60bz9gn39jyxr0000gn/T/pip-install-i1dmgg0t/pygatt_f414e8b0bd494db6b2e2a4233e9bc8f4/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' clean --all
       cwd: /private/var/folders/kq/y336n3157pd60bz9gn39jyxr0000gn/T/pip-install-i1dmgg0t/pygatt_f414e8b0bd494db6b2e2a4233e9bc8f4
  Complete output (27 lines):
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/private/var/folders/kq/y336n3157pd60bz9gn39jyxr0000gn/T/pip-install-i1dmgg0t/pygatt_f414e8b0bd494db6b2e2a4233e9bc8f4/setup.py", line 16, in <module>
      setup(
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/__init__.py", line 164, in setup
      _install_setup_requires(attrs)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/__init__.py", line 159, in _install_setup_requires
      dist.fetch_build_eggs(dist.setup_requires)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/dist.py", line 699, in fetch_build_eggs
      resolved_dists = pkg_resources.working_set.resolve(
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 779, in resolve
      dist = best[req.key] = env.best_match(
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1064, in best_match
      return self.obtain(req, installer)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1076, in obtain
      return installer(requirement)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/dist.py", line 758, in fetch_build_egg
      return fetch_build_egg(self, req)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/installer.py", line 133, in fetch_build_egg
      wheel.install_as_egg(dist_location)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/wheel.py", line 99, in install_as_egg
      self._install_as_egg(destination_eggdir, zf)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/wheel.py", line 107, in _install_as_egg
      self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/wheel.py", line 128, in _convert_metadata
      os.mkdir(destination_eggdir)
  FileExistsError: [Errno 17] File exists: '/private/var/folders/kq/y336n3157pd60bz9gn39jyxr0000gn/T/pip-install-i1dmgg0t/pygatt_f414e8b0bd494db6b2e2a4233e9bc8f4/.eggs/coverage-6.0.2-py3.8-macosx-10.14-arm64.egg'
  ----------------------------------------
  ERROR: Failed cleaning build dir for pygatt
Failed to build pygatt
Installing collected packages: pygatt, meshtastic
    Running setup.py install for pygatt ... error
    ERROR: Command errored out with exit status 1:
     command: /Library/Developer/CommandLineTools/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/kq/y336n3157pd60bz9gn39jyxr0000gn/T/pip-install-i1dmgg0t/pygatt_f414e8b0bd494db6b2e2a4233e9bc8f4/setup.py'"'"'; __file__='"'"'/private/var/folders/kq/y336n3157pd60bz9gn39jyxr0000gn/T/pip-install-i1dmgg0t/pygatt_f414e8b0bd494db6b2e2a4233e9bc8f4/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/kq/y336n3157pd60bz9gn39jyxr0000gn/T/pip-record-8ybzos5h/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/tekk/Library/Python/3.8/include/python3.8/pygatt
         cwd: /private/var/folders/kq/y336n3157pd60bz9gn39jyxr0000gn/T/pip-install-i1dmgg0t/pygatt_f414e8b0bd494db6b2e2a4233e9bc8f4/
    Complete output (27 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/kq/y336n3157pd60bz9gn39jyxr0000gn/T/pip-install-i1dmgg0t/pygatt_f414e8b0bd494db6b2e2a4233e9bc8f4/setup.py", line 16, in <module>
        setup(
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/__init__.py", line 164, in setup
        _install_setup_requires(attrs)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/__init__.py", line 159, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/dist.py", line 699, in fetch_build_eggs
        resolved_dists = pkg_resources.working_set.resolve(
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 779, in resolve
        dist = best[req.key] = env.best_match(
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1064, in best_match
        return self.obtain(req, installer)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1076, in obtain
        return installer(requirement)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/dist.py", line 758, in fetch_build_egg
        return fetch_build_egg(self, req)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/installer.py", line 133, in fetch_build_egg
        wheel.install_as_egg(dist_location)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/wheel.py", line 99, in install_as_egg
        self._install_as_egg(destination_eggdir, zf)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/wheel.py", line 107, in _install_as_egg
        self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/wheel.py", line 128, in _convert_metadata
        os.mkdir(destination_eggdir)
    FileExistsError: [Errno 17] File exists: '/private/var/folders/kq/y336n3157pd60bz9gn39jyxr0000gn/T/pip-install-i1dmgg0t/pygatt_f414e8b0bd494db6b2e2a4233e9bc8f4/.eggs/coverage-6.0.2-py3.8-macosx-10.14-arm64.egg'
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Developer/CommandLineTools/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/kq/y336n3157pd60bz9gn39jyxr0000gn/T/pip-install-i1dmgg0t/pygatt_f414e8b0bd494db6b2e2a4233e9bc8f4/setup.py'"'"'; __file__='"'"'/private/var/folders/kq/y336n3157pd60bz9gn39jyxr0000gn/T/pip-install-i1dmgg0t/pygatt_f414e8b0bd494db6b2e2a4233e9bc8f4/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/kq/y336n3157pd60bz9gn39jyxr0000gn/T/pip-record-8ybzos5h/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /Users/tekk/Library/Python/3.8/include/python3.8/pygatt Check the logs for full command output.

Suggestions are very welcome.

that looks like the install command for Termux for Android, make sure you select the β€œmacOS” tab on the docs: Meshtastic-python installation | Meshtastic

Thanks for the response.
Unfortunately, I have already tried that.
Here is the full output according to the instructions in the docs.

tekk@AiruzivtelaTekk git % python3 -V
Python 3.8.9
tekk@AiruzivtelaTekk git % brew -v
Homebrew 3.2.16
Homebrew/homebrew-core (git revision 078f6c2af3a; last commit 2021-10-15)
Homebrew/homebrew-cask (git revision bb15439691; last commit 2021-10-15)
tekk@AiruzivtelaTekk git % brew install python3
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core and homebrew/cask).
==> New Formulae
colima                                                                    fheroes2
==> Updated Formulae
Updated 15 formulae.
==> New Casks
pensela
==> Updated Casks
Updated 4 casks.
==> Deleted Casks
smallpdf

Warning: python@3.9 3.9.7_1 is already installed and up-to-date.
To reinstall 3.9.7_1, run:
  brew reinstall python@3.9
tekk@AiruzivtelaTekk git % pip3 -V
pip 21.3 from /Users/tekk/Library/Python/3.8/lib/python/site-packages/pip (python 3.8)
tekk@AiruzivtelaTekk git % sudo pip3 install --upgrade pytap2
Password:
WARNING: The directory '/Users/tekk/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
Requirement already satisfied: pytap2 in /Users/tekk/Library/Python/3.8/lib/python/site-packages (2.1.0)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
tekk@AiruzivtelaTekk git % sudo pip3 install --upgrade meshtastic
WARNING: The directory '/Users/tekk/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
Collecting meshtastic
  Downloading meshtastic-1.2.40-py3-none-any.whl (63 kB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 63 kB 4.2 MB/s             
Requirement already satisfied: pyqrcode>=1.2.1 in /Users/tekk/Library/Python/3.8/lib/python/site-packages (from meshtastic) (1.2.1)
Requirement already satisfied: pyserial>=3.4 in /Users/tekk/Library/Python/3.8/lib/python/site-packages (from meshtastic) (3.5)
Requirement already satisfied: tabulate>=0.8.9 in /Users/tekk/Library/Python/3.8/lib/python/site-packages (from meshtastic) (0.8.9)
Requirement already satisfied: pexpect>=4.6.0 in /Users/tekk/Library/Python/3.8/lib/python/site-packages (from meshtastic) (4.8.0)
Requirement already satisfied: protobuf>=3.13.0 in /Users/tekk/Library/Python/3.8/lib/python/site-packages (from meshtastic) (3.18.1)
Requirement already satisfied: timeago>=1.0.15 in /Users/tekk/Library/Python/3.8/lib/python/site-packages (from meshtastic) (1.0.15)
Collecting pygatt>=4.0.5
  Downloading pygatt-4.0.5.tar.gz (40 kB)
     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 40 kB 37.0 MB/s            
  Preparing metadata (setup.py) ... done
Requirement already satisfied: dotmap>=1.3.14 in /Users/tekk/Library/Python/3.8/lib/python/site-packages (from meshtastic) (1.3.24)
Requirement already satisfied: pypubsub>=4.0.3 in /Users/tekk/Library/Python/3.8/lib/python/site-packages (from meshtastic) (4.0.3)
Requirement already satisfied: ptyprocess>=0.5 in /Users/tekk/Library/Python/3.8/lib/python/site-packages (from pexpect>=4.6.0->meshtastic) (0.7.0)
Requirement already satisfied: enum-compat in /Users/tekk/Library/Python/3.8/lib/python/site-packages (from pygatt>=4.0.5->meshtastic) (0.0.3)
Building wheels for collected packages: pygatt
  Building wheel for pygatt (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Library/Developer/CommandLineTools/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-5lsu1l6m/pygatt_6129b6d8fa424214981d83e669d5e79d/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-5lsu1l6m/pygatt_6129b6d8fa424214981d83e669d5e79d/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/tmp/pip-wheel-2btecjud
       cwd: /private/tmp/pip-install-5lsu1l6m/pygatt_6129b6d8fa424214981d83e669d5e79d/
  Complete output (28 lines):
  WARNING: The directory '/Users/tekk/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/private/tmp/pip-install-5lsu1l6m/pygatt_6129b6d8fa424214981d83e669d5e79d/setup.py", line 16, in <module>
      setup(
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/__init__.py", line 164, in setup
      _install_setup_requires(attrs)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/__init__.py", line 159, in _install_setup_requires
      dist.fetch_build_eggs(dist.setup_requires)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/dist.py", line 699, in fetch_build_eggs
      resolved_dists = pkg_resources.working_set.resolve(
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 779, in resolve
      dist = best[req.key] = env.best_match(
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1064, in best_match
      return self.obtain(req, installer)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1076, in obtain
      return installer(requirement)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/dist.py", line 758, in fetch_build_egg
      return fetch_build_egg(self, req)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/installer.py", line 133, in fetch_build_egg
      wheel.install_as_egg(dist_location)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/wheel.py", line 99, in install_as_egg
      self._install_as_egg(destination_eggdir, zf)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/wheel.py", line 107, in _install_as_egg
      self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/wheel.py", line 128, in _convert_metadata
      os.mkdir(destination_eggdir)
  FileExistsError: [Errno 17] File exists: '/private/tmp/pip-install-5lsu1l6m/pygatt_6129b6d8fa424214981d83e669d5e79d/.eggs/coverage-6.0.2-py3.8-macosx-10.14-arm64.egg'
  ----------------------------------------
  ERROR: Failed building wheel for pygatt
  Running setup.py clean for pygatt
  ERROR: Command errored out with exit status 1:
   command: /Library/Developer/CommandLineTools/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-5lsu1l6m/pygatt_6129b6d8fa424214981d83e669d5e79d/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-5lsu1l6m/pygatt_6129b6d8fa424214981d83e669d5e79d/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' clean --all
       cwd: /private/tmp/pip-install-5lsu1l6m/pygatt_6129b6d8fa424214981d83e669d5e79d
  Complete output (28 lines):
  WARNING: The directory '/Users/tekk/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/private/tmp/pip-install-5lsu1l6m/pygatt_6129b6d8fa424214981d83e669d5e79d/setup.py", line 16, in <module>
      setup(
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/__init__.py", line 164, in setup
      _install_setup_requires(attrs)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/__init__.py", line 159, in _install_setup_requires
      dist.fetch_build_eggs(dist.setup_requires)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/dist.py", line 699, in fetch_build_eggs
      resolved_dists = pkg_resources.working_set.resolve(
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 779, in resolve
      dist = best[req.key] = env.best_match(
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1064, in best_match
      return self.obtain(req, installer)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1076, in obtain
      return installer(requirement)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/dist.py", line 758, in fetch_build_egg
      return fetch_build_egg(self, req)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/installer.py", line 133, in fetch_build_egg
      wheel.install_as_egg(dist_location)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/wheel.py", line 99, in install_as_egg
      self._install_as_egg(destination_eggdir, zf)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/wheel.py", line 107, in _install_as_egg
      self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
    File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/wheel.py", line 128, in _convert_metadata
      os.mkdir(destination_eggdir)
  FileExistsError: [Errno 17] File exists: '/private/tmp/pip-install-5lsu1l6m/pygatt_6129b6d8fa424214981d83e669d5e79d/.eggs/coverage-6.0.2-py3.8-macosx-10.14-arm64.egg'
  ----------------------------------------
  ERROR: Failed cleaning build dir for pygatt
Failed to build pygatt
Installing collected packages: pygatt, meshtastic
    Running setup.py install for pygatt ... error
    ERROR: Command errored out with exit status 1:
     command: /Library/Developer/CommandLineTools/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-5lsu1l6m/pygatt_6129b6d8fa424214981d83e669d5e79d/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-5lsu1l6m/pygatt_6129b6d8fa424214981d83e669d5e79d/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/tmp/pip-record-whvyn89y/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Python/3.8/include/pygatt
         cwd: /private/tmp/pip-install-5lsu1l6m/pygatt_6129b6d8fa424214981d83e669d5e79d/
    Complete output (28 lines):
    WARNING: The directory '/Users/tekk/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/tmp/pip-install-5lsu1l6m/pygatt_6129b6d8fa424214981d83e669d5e79d/setup.py", line 16, in <module>
        setup(
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/__init__.py", line 164, in setup
        _install_setup_requires(attrs)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/__init__.py", line 159, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/dist.py", line 699, in fetch_build_eggs
        resolved_dists = pkg_resources.working_set.resolve(
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 779, in resolve
        dist = best[req.key] = env.best_match(
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1064, in best_match
        return self.obtain(req, installer)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1076, in obtain
        return installer(requirement)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/dist.py", line 758, in fetch_build_egg
        return fetch_build_egg(self, req)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/installer.py", line 133, in fetch_build_egg
        wheel.install_as_egg(dist_location)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/wheel.py", line 99, in install_as_egg
        self._install_as_egg(destination_eggdir, zf)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/wheel.py", line 107, in _install_as_egg
        self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
      File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/wheel.py", line 128, in _convert_metadata
        os.mkdir(destination_eggdir)
    FileExistsError: [Errno 17] File exists: '/private/tmp/pip-install-5lsu1l6m/pygatt_6129b6d8fa424214981d83e669d5e79d/.eggs/coverage-6.0.2-py3.8-macosx-10.14-arm64.egg'
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Developer/CommandLineTools/usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-5lsu1l6m/pygatt_6129b6d8fa424214981d83e669d5e79d/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-5lsu1l6m/pygatt_6129b6d8fa424214981d83e669d5e79d/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/tmp/pip-record-whvyn89y/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Python/3.8/include/pygatt Check the logs for full command output.
tekk@AiruzivtelaTekk git % 

What a strange error. Can’t say I know the solution, so throwing out some ideas:

if the folder /private/tmp/pip-install-5lsu1l6m/ still exists after installation fail;

  • make sure this folder name changes for each install (otherwise try renaming it);
  • if coverage-6.0.2-py3.8-macosx-10.14-arm64.egg really exists inside;

You could try a manual install, it is more verbose and easier to follow:

git clone https://github.com/peplin/pygatt.git
cd pygatt
sudo python3 setup.py install

1 Like

Thank you for your suggestions,
that directory wasn’t there.
Manual install went well and I was able to install Meshtastic without any issues, and I’m able to use it.
I appreciate your help regarding this topic.
Thanks!

1 Like