question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Installation error on macOS

See original GitHub issue

Issue

pip install torch-scatter fails on macOS, within a conda environment with Python 3.6.

Error

Collecting torch-scatter
  Using cached https://files.pythonhosted.org/packages/30/d9/1d5fd4d183dabd9e0a1f7008ecf83318432359f4cc27480e3f2212f44d9c/torch_scatter-1.3.2.tar.gz
Building wheels for collected packages: torch-scatter
  Building wheel for torch-scatter (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/rmeli/miniconda3/envs/py36t/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/r0/2dklzyn57d59g13_21b6kt7h0000gp/T/pip-install-24jrv0_u/torch-scatter/setup.py'"'"'; __file__='"'"'/private/var/folders/r0/2dklzyn57d59g13_21b6kt7h0000gp/T/pip-install-24jrv0_u/torch-scatter/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/r0/2dklzyn57d59g13_21b6kt7h0000gp/T/pip-wheel-js5n7cck --python-tag cp36
       cwd: /private/var/folders/r0/2dklzyn57d59g13_21b6kt7h0000gp/T/pip-install-24jrv0_u/torch-scatter/
  Complete output (60 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.7-x86_64-3.6
  creating build/lib.macosx-10.7-x86_64-3.6/test
  copying test/test_std.py -> build/lib.macosx-10.7-x86_64-3.6/test
  copying test/test_max_min.py -> build/lib.macosx-10.7-x86_64-3.6/test
  copying test/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/test
  copying test/test_broadcasting.py -> build/lib.macosx-10.7-x86_64-3.6/test
  copying test/test_multi_gpu.py -> build/lib.macosx-10.7-x86_64-3.6/test
  copying test/test_forward.py -> build/lib.macosx-10.7-x86_64-3.6/test
  copying test/utils.py -> build/lib.macosx-10.7-x86_64-3.6/test
  copying test/test_backward.py -> build/lib.macosx-10.7-x86_64-3.6/test
  creating build/lib.macosx-10.7-x86_64-3.6/torch_scatter
  copying torch_scatter/max.py -> build/lib.macosx-10.7-x86_64-3.6/torch_scatter
  copying torch_scatter/add.py -> build/lib.macosx-10.7-x86_64-3.6/torch_scatter
  copying torch_scatter/div.py -> build/lib.macosx-10.7-x86_64-3.6/torch_scatter
  copying torch_scatter/std.py -> build/lib.macosx-10.7-x86_64-3.6/torch_scatter
  copying torch_scatter/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/torch_scatter
  copying torch_scatter/min.py -> build/lib.macosx-10.7-x86_64-3.6/torch_scatter
  copying torch_scatter/mean.py -> build/lib.macosx-10.7-x86_64-3.6/torch_scatter
  copying torch_scatter/mul.py -> build/lib.macosx-10.7-x86_64-3.6/torch_scatter
  copying torch_scatter/sub.py -> build/lib.macosx-10.7-x86_64-3.6/torch_scatter
  creating build/lib.macosx-10.7-x86_64-3.6/torch_scatter/utils
  copying torch_scatter/utils/gen.py -> build/lib.macosx-10.7-x86_64-3.6/torch_scatter/utils
  copying torch_scatter/utils/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/torch_scatter/utils
  copying torch_scatter/utils/ext.py -> build/lib.macosx-10.7-x86_64-3.6/torch_scatter/utils
  running build_ext
  /Users/rmeli/miniconda3/envs/py36t/lib/python3.6/site-packages/torch/utils/cpp_extension.py:172: UserWarning:
  
                                 !! WARNING !!
  
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  Your compiler (g++) is not compatible with the compiler Pytorch was
  built with for this platform, which is clang++ on darwin. Please
  use clang++ to to compile your extension. Alternatively, you may
  compile PyTorch from source using g++, and then you can also use
  g++ to compile your extension.
  
  See https://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.md for help
  with compiling PyTorch from source.
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  
                                !! WARNING !!
  
    platform=sys.platform))
  building 'torch_scatter.scatter_cpu' extension
  creating build/temp.macosx-10.7-x86_64-3.6
  creating build/temp.macosx-10.7-x86_64-3.6/cpu
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/rmeli/miniconda3/envs/py36t/include -arch x86_64 -I/Users/rmeli/miniconda3/envs/py36t/include -arch x86_64 -I/Users/rmeli/miniconda3/envs/py36t/lib/python3.6/site-packages/torch/include -I/Users/rmeli/miniconda3/envs/py36t/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/Users/rmeli/miniconda3/envs/py36t/lib/python3.6/site-packages/torch/include/TH -I/Users/rmeli/miniconda3/envs/py36t/lib/python3.6/site-packages/torch/include/THC -I/Users/rmeli/miniconda3/envs/py36t/include/python3.6m -c cpu/scatter.cpp -o build/temp.macosx-10.7-x86_64-3.6/cpu/scatter.o -Wno-unused-variable -DVERSION_GE_1_3 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=scatter_cpu -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
  warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
  In file included from cpu/scatter.cpp:1:
  In file included from /Users/rmeli/miniconda3/envs/py36t/lib/python3.6/site-packages/torch/include/torch/extension.h:4:
  In file included from /Users/rmeli/miniconda3/envs/py36t/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/all.h:3:
  /Users/rmeli/miniconda3/envs/py36t/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/cuda.h:5:10: fatal error: 'cstddef' file not found
  #include <cstddef>
           ^~~~~~~~~
  1 warning and 1 error generated.
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for torch-scatter
  Running setup.py clean for torch-scatter
Failed to build torch-scatter
Installing collected packages: torch-scatter
    Running setup.py install for torch-scatter ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/rmeli/miniconda3/envs/py36t/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/r0/2dklzyn57d59g13_21b6kt7h0000gp/T/pip-install-24jrv0_u/torch-scatter/setup.py'"'"'; __file__='"'"'/private/var/folders/r0/2dklzyn57d59g13_21b6kt7h0000gp/T/pip-install-24jrv0_u/torch-scatter/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/r0/2dklzyn57d59g13_21b6kt7h0000gp/T/pip-record-h3mh8ud7/install-record.txt --single-version-externally-managed --compile
         cwd: /private/var/folders/r0/2dklzyn57d59g13_21b6kt7h0000gp/T/pip-install-24jrv0_u/torch-scatter/
    Complete output (60 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.7-x86_64-3.6
    creating build/lib.macosx-10.7-x86_64-3.6/test
    copying test/test_std.py -> build/lib.macosx-10.7-x86_64-3.6/test
    copying test/test_max_min.py -> build/lib.macosx-10.7-x86_64-3.6/test
    copying test/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/test
    copying test/test_broadcasting.py -> build/lib.macosx-10.7-x86_64-3.6/test
    copying test/test_multi_gpu.py -> build/lib.macosx-10.7-x86_64-3.6/test
    copying test/test_forward.py -> build/lib.macosx-10.7-x86_64-3.6/test
    copying test/utils.py -> build/lib.macosx-10.7-x86_64-3.6/test
    copying test/test_backward.py -> build/lib.macosx-10.7-x86_64-3.6/test
    creating build/lib.macosx-10.7-x86_64-3.6/torch_scatter
    copying torch_scatter/max.py -> build/lib.macosx-10.7-x86_64-3.6/torch_scatter
    copying torch_scatter/add.py -> build/lib.macosx-10.7-x86_64-3.6/torch_scatter
    copying torch_scatter/div.py -> build/lib.macosx-10.7-x86_64-3.6/torch_scatter
    copying torch_scatter/std.py -> build/lib.macosx-10.7-x86_64-3.6/torch_scatter
    copying torch_scatter/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/torch_scatter
    copying torch_scatter/min.py -> build/lib.macosx-10.7-x86_64-3.6/torch_scatter
    copying torch_scatter/mean.py -> build/lib.macosx-10.7-x86_64-3.6/torch_scatter
    copying torch_scatter/mul.py -> build/lib.macosx-10.7-x86_64-3.6/torch_scatter
    copying torch_scatter/sub.py -> build/lib.macosx-10.7-x86_64-3.6/torch_scatter
    creating build/lib.macosx-10.7-x86_64-3.6/torch_scatter/utils
    copying torch_scatter/utils/gen.py -> build/lib.macosx-10.7-x86_64-3.6/torch_scatter/utils
    copying torch_scatter/utils/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/torch_scatter/utils
    copying torch_scatter/utils/ext.py -> build/lib.macosx-10.7-x86_64-3.6/torch_scatter/utils
    running build_ext
    /Users/rmeli/miniconda3/envs/py36t/lib/python3.6/site-packages/torch/utils/cpp_extension.py:172: UserWarning:
    
                                   !! WARNING !!
    
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    Your compiler (g++) is not compatible with the compiler Pytorch was
    built with for this platform, which is clang++ on darwin. Please
    use clang++ to to compile your extension. Alternatively, you may
    compile PyTorch from source using g++, and then you can also use
    g++ to compile your extension.
    
    See https://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.md for help
    with compiling PyTorch from source.
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    
                                  !! WARNING !!
    
      platform=sys.platform))
    building 'torch_scatter.scatter_cpu' extension
    creating build/temp.macosx-10.7-x86_64-3.6
    creating build/temp.macosx-10.7-x86_64-3.6/cpu
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/rmeli/miniconda3/envs/py36t/include -arch x86_64 -I/Users/rmeli/miniconda3/envs/py36t/include -arch x86_64 -I/Users/rmeli/miniconda3/envs/py36t/lib/python3.6/site-packages/torch/include -I/Users/rmeli/miniconda3/envs/py36t/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/Users/rmeli/miniconda3/envs/py36t/lib/python3.6/site-packages/torch/include/TH -I/Users/rmeli/miniconda3/envs/py36t/lib/python3.6/site-packages/torch/include/THC -I/Users/rmeli/miniconda3/envs/py36t/include/python3.6m -c cpu/scatter.cpp -o build/temp.macosx-10.7-x86_64-3.6/cpu/scatter.o -Wno-unused-variable -DVERSION_GE_1_3 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=scatter_cpu -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
    warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
    In file included from cpu/scatter.cpp:1:
    In file included from /Users/rmeli/miniconda3/envs/py36t/lib/python3.6/site-packages/torch/include/torch/extension.h:4:
    In file included from /Users/rmeli/miniconda3/envs/py36t/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/all.h:3:
    /Users/rmeli/miniconda3/envs/py36t/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/cuda.h:5:10: fatal error: 'cstddef' file not found
    #include <cstddef>
             ^~~~~~~~~
    1 warning and 1 error generated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/rmeli/miniconda3/envs/py36t/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/r0/2dklzyn57d59g13_21b6kt7h0000gp/T/pip-install-24jrv0_u/torch-scatter/setup.py'"'"'; __file__='"'"'/private/var/folders/r0/2dklzyn57d59g13_21b6kt7h0000gp/T/pip-install-24jrv0_u/torch-scatter/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/r0/2dklzyn57d59g13_21b6kt7h0000gp/T/pip-record-h3mh8ud7/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

Environment

conda create -n py36 python=3.6 pip
conda activate py36
conda install pytorch=1.3 -c pytorch

Additional Details

Python 3.7

Using Python 3.7 istead of 3.6 does not fail…

conda create -n py37 python=3.7 pip
conda activate py37
conda install pytorch=1.3 -c pytorch
pip install torch-scatter
Processing /Users/rmeli/Library/Caches/pip/wheels/40/30/07/5400c1a1ec05c5d0d6459fb2179d0e12c7c2f6d3d47987bf10/torch_scatter-1.3.2-cp37-cp37m-macosx_10_9_x86_64.whl
Installing collected packages: torch-scatter
Successfully installed torch-scatter-1.3.2

Linux

I have CI setup on a private repo where I’m trying to use pytorch_goemteric. This error occours only with macOS builds using Python 3.6 (both with xcode11 and xcode10). Linux builds work normally (both versions of Python, both Xenial and Bionic).

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rusty1scommented, Oct 21, 2019

Ah I see, that’s interesting. I added this note to the documentation.

0reactions
RMelicommented, Oct 21, 2019

Using Python 3.7 instead of 3.6 does not fail…

I think this is the reason, which is very strange. Using Python 3.7 works (both on Travis CI and locally), but the reported error happens with 3.6.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix the "macOS Could Not Be Installed on Your ...
1. Restart Your Mac and Retry the Installation ... Sometimes, all you need to do to fix macOS errors is to restart your...
Read more >
How to Fix macOS “Installation failed, An error occurred while ...
How To Fix The Installation Failed Error on macOS · Try Downloading The Update at Another Time · Reboot Your Mac · Make...
Read more >
Fix macOS “Installation failed, An error occurred while ...
1. Restart your Mac in Safe Boot mode (restart and immediately hold the Shift key until you see the login prompt.) 2. Applications...
Read more >
Mac Installation Errors You May Encounter and How to Fix Them
It may seem odd but the usual cause is a corrupt installer, and simply deleting the installer app and downloading a new copy...
Read more >
9 Ways to Fix an Error Occurred While Preparing the Installation
【Fixed】How to Fix an Error Occurred While Preparing the Installation Error? · Fix 1: Restart your Mac · Fix 2: Check the Date...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found