google / pytype

A static type analyzer for Python code

Home Page:https://google.github.io/pytype

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pip install fails on MacOS 11.4 on arm64 (PEP 517)

reagle opened this issue · comments

...

      File "/private/var/folders/2l/73vdx0sd5rvcn38yg036h6500000gp/T/pip-build-env-3a1hopxr/overlay/lib/python3.9/site-packages/skbuild/cmaker.py", line 81, in get_cmake_version
        raise SKBuildError(
    Traceback (most recent call last):

    Problem with the CMake installation, aborting build. CMake executable is cmake
    ----------------------------------------
    ERROR: Failed building wheel for ninja
  Failed to build ninja
  ERROR: Could not build wheels for ninja which use PEP 517 and cannot be installed directly
  ----------------------------------------
WARNING: Discarding file:///Users/reagle/Downloads/pytype. Command errored out with exit status 1: /opt/homebrew/opt/python@3.9/bin/python3.9 /private/var/folders/2l/73vdx0sd5rvcn38yg036h6500000gp/T/pip-standalone-pip-1xwnfryi/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /private/var/folders/2l/73vdx0sd5rvcn38yg036h6500000gp/T/pip-build-env-98iwdhl3/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' ninja wheel pybind11==2.6.0rc3 Check the logs for full command output.
ERROR: Command errored out with exit status 1: /opt/homebrew/opt/python@3.9/bin/python3.9 /private/var/folders/2l/73vdx0sd5rvcn38yg036h6500000gp/T/pip-standalone-pip-1xwnfryi/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /private/var/folders/2l/73vdx0sd5rvcn38yg036h6500000gp/T/pip-build-env-98iwdhl3/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' ninja wheel pybind11==2.6.0rc3 Check the logs for full command output.

Thanks for the report! According to pypa/pip#6256, that error message referencing PEP 517 simply means that the wheel failed to build - the actual cause is probably somewhere else in the output. Any chance you could include more of the log?

Here's the more complete context, if you want me to increase verbosity or something just tell me how.

╰─➤  pip3 install pytype
Collecting pytype
  Using cached pytype-2021.6.17.tar.gz (2.2 MB)
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: /opt/homebrew/opt/python@3.9/bin/python3.9 /private/var/folders/2l/73vdx0sd5rvcn38yg036h6500000gp/T/pip-standalone-pip-93xoxv5g/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /private/var/folders/2l/73vdx0sd5rvcn38yg036h6500000gp/T/pip-build-env-l4hes8gi/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' ninja wheel pybind11==2.6.0rc3
       cwd: None
  Complete output (34 lines):
  Collecting setuptools>=40.8.0
    Downloading setuptools-57.2.0-py3-none-any.whl (818 kB)
  Collecting ninja
    Using cached ninja-1.10.0.post2.tar.gz (25 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 wheel metadata: started
      Preparing wheel metadata: finished with status 'done'
  Collecting wheel
    Using cached wheel-0.36.2-py2.py3-none-any.whl (35 kB)
  Collecting pybind11==2.6.0rc3
    Using cached pybind11-2.6.0rc3-py2.py3-none-any.whl (187 kB)
  Building wheels for collected packages: ninja
    Building wheel for ninja (PEP 517): started
    Building wheel for ninja (PEP 517): finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /opt/homebrew/opt/python@3.9/bin/python3.9 /var/folders/2l/73vdx0sd5rvcn38yg036h6500000gp/T/tmpklt7i8la_in_process.py build_wheel /var/folders/2l/73vdx0sd5rvcn38yg036h6500000gp/T/tmptbvvs7ac
         cwd: /private/var/folders/2l/73vdx0sd5rvcn38yg036h6500000gp/T/pip-install-446zbhdv/ninja_35e76f1d8ca743bc8166873ec748025e
    Complete output (9 lines):
      File "/private/var/folders/2l/73vdx0sd5rvcn38yg036h6500000gp/T/pip-build-env-4ajg0u02/overlay/lib/python3.9/site-packages/skbuild/setuptools_wrap.py", line 560, in setup
        cmkr = cmaker.CMaker(cmake_executable)
      File "/private/var/folders/2l/73vdx0sd5rvcn38yg036h6500000gp/T/pip-build-env-4ajg0u02/overlay/lib/python3.9/site-packages/skbuild/cmaker.py", line 95, in __init__
        self.cmake_version = get_cmake_version(self.cmake_executable)
      File "/private/var/folders/2l/73vdx0sd5rvcn38yg036h6500000gp/T/pip-build-env-4ajg0u02/overlay/lib/python3.9/site-packages/skbuild/cmaker.py", line 81, in get_cmake_version
        raise SKBuildError(
    Traceback (most recent call last):

    Problem with the CMake installation, aborting build. CMake executable is cmake
    ----------------------------------------
    ERROR: Failed building wheel for ninja
  Failed to build ninja
  ERROR: Could not build wheels for ninja which use PEP 517 and cannot be installed directly
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/1d/6d/42e88d2203832851a08ce8bb4381d8c67f5e3f82ff57598f511de6baac31/pytype-2021.6.17.tar.gz#sha256=8f11a4b93fb807ff849a0cbff926c17ef6147f5f5bb8a28875e8fbea91b853f5 (from https://pypi.org/simple/pytype/) (requires-python:<3.10,>=3.6). Command errored out with exit status 1: /opt/homebrew/opt/python@3.9/bin/python3.9 /private/var/folders/2l/73vdx0sd5rvcn38yg036h6500000gp/T/pip-standalone-pip-93xoxv5g/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /private/var/folders/2l/73vdx0sd5rvcn38yg036h6500000gp/T/pip-build-env-l4hes8gi/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' ninja wheel pybind11==2.6.0rc3 Check the logs for full command output.
...

Also, if you want to know my environment, just let me know what you want. I do have Rosetta installed, which I (only) use for two Python apps (zim wiki and pytype).

Thanks! I took a look at the code triggering the SKBuildError (https://github.com/scikit-build/scikit-build/blob/a7c746ae47d27b641f5734103e8fa4aaaabc09e3/skbuild/cmaker.py#L78-L82):

try:
    version_string = subprocess.check_output([cmake_executable, '--version'])
except (OSError, subprocess.CalledProcessError):
    raise SKBuildError(
        "Problem with the CMake installation, aborting build. CMake executable is %s" % cmake_executable)

It would appear that ninja installation is failing when attempting to run cmake --version.

  • Are you able to manually run cmake --version? If not, perhaps you need to install or upgrade cmake.
  • Can you run pip install ninja? I'm curious whether installing ninja always fails or only when it's a pytype dep.

(Apologies I can't do any of this troubleshooting myself; I and the other pytype devs are all on Linux ^^;)

Thanks! cmake was not available in my path and did not appear to be installed (brew or cask) with either architecture of homebrew. Even so, when using Rosetta2/x86_6 pytype did install...?

Fortunately, installing the brew of cmake with arch --arm64 homebrew does the trick for building an M1 version of pytype via the arm64 python/pip.

This issue could be closed, but referenced in a follow-up as a dependency issue.

Great, glad you were able to figure it out! I'll add a note to the Installation section of the README with a link to this bug.