Cannot install pytorch on mac with cuda

username: Shiyu
cooked: <p>I am trying to install pytorch on mac sierra with GTX 1080 Ti, CUDA and web driver are both fine.</p>
<p>The command I am using to install are</p>
<pre><code class="lang-bash">git clone https://github.com/pytorch/pytorch.git
export CMAKE_PREFIX_PATH=/Users/liangshiyu/anaconda2
conda install numpy pyyaml setuptools cmake cffi
cd pytorch
MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ python setup.py install
</code></pre>
<p>In the last step, I have encountered the following error and when I am trying to code, it says there is no module name torch. Any suggestion would be helpful, thanks.</p>
<pre><code class="lang-auto">running install
running build_deps
/Users/liangshiyu/Desktop/pytorch/torch/_thnn/utils.py:1: RuntimeWarning: Parent module 'torch._thnn' not found while handling absolute import
  import os
/Users/liangshiyu/Desktop/pytorch/torch/_thnn/utils.py:2: RuntimeWarning: Parent module 'torch._thnn' not found while handling absolute import
  import itertools
/Users/liangshiyu/Desktop/pytorch/torch/_thnn/utils.py:3: RuntimeWarning: Parent module 'torch._thnn' not found while handling absolute import
  import importlib
-- The C compiler identification is AppleClang 7.0.2.7000181
-- The CXX compiler identification is AppleClang 7.0.2.7000181
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -- works
-- Detecting C compiler ABI info
-- Checking if C linker supports --verbose
-- Checking if C linker supports --verbose - no
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Checking if CXX linker supports --verbose
-- Checking if CXX linker supports --verbose - no
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Try OpenMP C flag = [-fopenmp=libomp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [ ]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [/openmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [-Qopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [-openmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [-xopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [+Oopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [-qsmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP C flag = [-mp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [-fopenmp=libomp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [ ]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [/openmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [-Qopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [-openmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [-xopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [+Oopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [-qsmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Try OpenMP CXX flag = [-mp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Failed
-- Could NOT find OpenMP (missing:  OpenMP_C_FLAGS OpenMP_CXX_FLAGS) 
-- Could not find hardware support for NEON on this machine.
-- No OMAP3 processor on this machine.
-- No OMAP4 processor on this machine.
-- Looking for cpuid.h
-- Looking for cpuid.h - found
-- Performing Test HAVE_GCC_GET_CPUID
-- Performing Test HAVE_GCC_GET_CPUID - Success
-- Performing Test NO_GCC_EBX_FPIC_BUG
-- Performing Test NO_GCC_EBX_FPIC_BUG - Success
-- Performing Test C_HAS_SSE1_1
-- Performing Test C_HAS_SSE1_1 - Success
-- Performing Test C_HAS_SSE2_1
-- Performing Test C_HAS_SSE2_1 - Success
-- Performing Test C_HAS_SSE3_1
-- Performing Test C_HAS_SSE3_1 - Success
-- Performing Test C_HAS_SSE4_1_1
-- Performing Test C_HAS_SSE4_1_1 - Failed
-- Performing Test C_HAS_SSE4_1_2
-- Performing Test C_HAS_SSE4_1_2 - Success
-- Performing Test C_HAS_SSE4_2_1
-- Performing Test C_HAS_SSE4_2_1 - Failed
-- Performing Test C_HAS_SSE4_2_2
-- Performing Test C_HAS_SSE4_2_2 - Success
-- Performing Test C_HAS_AVX_1
-- Performing Test C_HAS_AVX_1 - Failed
-- Performing Test C_HAS_AVX_2
-- Performing Test C_HAS_AVX_2 - Success
-- Performing Test C_HAS_AVX2_1
-- Performing Test C_HAS_AVX2_1 - Failed
-- Performing Test C_HAS_AVX2_2
-- Performing Test C_HAS_AVX2_2 - Failed
-- Performing Test C_HAS_AVX2_3
-- Performing Test C_HAS_AVX2_3 - Failed
-- Performing Test CXX_HAS_SSE1_1
-- Performing Test CXX_HAS_SSE1_1 - Success
-- Performing Test CXX_HAS_SSE2_1
-- Performing Test CXX_HAS_SSE2_1 - Success
-- Performing Test CXX_HAS_SSE3_1
-- Performing Test CXX_HAS_SSE3_1 - Success
-- Performing Test CXX_HAS_SSE4_1_1
-- Performing Test CXX_HAS_SSE4_1_1 - Failed
-- Performing Test CXX_HAS_SSE4_1_2
-- Performing Test CXX_HAS_SSE4_1_2 - Success
-- Performing Test CXX_HAS_SSE4_2_1
-- Performing Test CXX_HAS_SSE4_2_1 - Failed
-- Performing Test CXX_HAS_SSE4_2_2
-- Performing Test CXX_HAS_SSE4_2_2 - Success
-- Performing Test CXX_HAS_AVX_1
-- Performing Test CXX_HAS_AVX_1 - Failed
-- Performing Test CXX_HAS_AVX_2
-- Performing Test CXX_HAS_AVX_2 - Success
-- Performing Test CXX_HAS_AVX2_1
-- Performing Test CXX_HAS_AVX2_1 - Failed
-- Performing Test CXX_HAS_AVX2_2
-- Performing Test CXX_HAS_AVX2_2 - Failed
-- Performing Test CXX_HAS_AVX2_3
-- Performing Test CXX_HAS_AVX2_3 - Failed
-- SSE2 Found
-- SSE3 Found
-- AVX Found
-- Performing Test HAS_C11_ATOMICS
-- Performing Test HAS_C11_ATOMICS - Failed
-- Performing Test HAS_MSC_ATOMICS
-- Performing Test HAS_MSC_ATOMICS - Failed
-- Performing Test HAS_GCC_ATOMICS
-- Performing Test HAS_GCC_ATOMICS - Success
-- TH_SO_VERSION: 1
-- Atomics: using GCC intrinsics
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of void*
-- Check size of void* - done
-- Checking for [mkl_intel_lp64 - mkl_intel_thread - mkl_core - iomp5 - pthread - m]
--   Library mkl_intel_lp64: /Users/liangshiyu/anaconda2/lib/libmkl_intel_lp64.dylib
--   Library mkl_intel_thread: /Users/liangshiyu/anaconda2/lib/libmkl_intel_thread.dylib
--   Library mkl_core: /Users/liangshiyu/anaconda2/lib/libmkl_core.dylib
--   Library iomp5: /Users/liangshiyu/anaconda2/lib/libiomp5.dylib
--   Library pthread: /usr/lib/libpthread.dylib
--   Library m: /usr/lib/libm.dylib
-- Looking for cblas_sgemm
-- Looking for cblas_sgemm - found
-- MKL library found
-- Performing Test BLAS_F2C_DOUBLE_WORKS
-- Performing Test BLAS_F2C_DOUBLE_WORKS - Failed
-- Performing Test BLAS_F2C_FLOAT_WORKS
-- Performing Test BLAS_F2C_FLOAT_WORKS - Success
-- Found a library with BLAS API (mkl).
-- Found a library with LAPACK API. (mkl)
-- Looking for mmap
-- Looking for mmap - found
-- Looking for shm_open
-- Looking for shm_open - found
-- Looking for shm_unlink
-- Looking for shm_unlink - found
-- Looking for malloc_usable_size
-- Looking for malloc_usable_size - not found
-- Performing Test C_HAS_THREAD
-- Performing Test C_HAS_THREAD - Success
-- Configuring done
CMake Warning (dev):
  Policy CMP0042 is not set: MACOSX_RPATH is enabled by default.  Run "cmake
  --help-policy CMP0042" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  MACOSX_RPATH is not specified for the following targets:

   TH

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CUDA_NVCC_FLAGS
    NO_CUDA
    THCS_LIBRARIES
    THCUNN_SO_VERSION
    THC_LIBRARIES
    THC_SO_VERSION
    THD_SO_VERSION
    THNN_SO_VERSION
    THPP_LIBRARIES
    THS_LIBRARIES
    TH_INCLUDE_PATH
    TH_LIB_PATH
    Torch_FOUND


-- Build files have been written to: /Users/liangshiyu/Desktop/pytorch/torch/lib/build/TH
Scanning dependencies of target TH
[  5%] Building C object CMakeFiles/TH.dir/THGeneral.c.o
[ 10%] Building C object CMakeFiles/TH.dir/THAllocator.c.o
[ 15%] Building C object CMakeFiles/TH.dir/THHalf.c.o
[ 21%] Building C object CMakeFiles/TH.dir/THStorage.c.o
[ 26%] Building C object CMakeFiles/TH.dir/THTensor.c.o
clang: warning: -Wl,-rpath,@loader_path: 'linker' input unused
clang: warning: argument unused during compilation: '-L/Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/lib'
[ 31%] Building C object CMakeFiles/TH.dir/THLogAdd.c.o
clang: warning: -Wl,-rpath,@loader_path: 'linker' input unused
clang: warning: argument unused during compilation: '-L/Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/lib'
[ 36%] Building C object CMakeFiles/TH.dir/THBlas.c.o
clang: warning: -Wl,-rpath,@loader_path: 'linker' input unused
clang: warning: argument unused during compilation: '-L/Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/lib'
[ 47%] Building C object CMakeFiles/TH.dir/THFile.c.o
[ 47%] Building C object CMakeFiles/TH.dir/THLapack.c.o
clang: warning: -Wl,-rpath,@loader_path: 'linker' input unused
clang: warning: argument unused during compilation: '-L/Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/lib'
clang: warning: -Wl,-rpath,@loader_path: 'linker' input unused
clang: warning: -Wl,-rpath,@loader_path: 'linker' input unused
clang: warning: argument unused during compilation: '-L/Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/lib'
[ 57%] Building C object CMakeFiles/TH.dir/THRandom.c.o
[ 68%] Building C object CMakeFiles/TH.dir/THMemoryFile.c.o
clang: warning: argument unused during compilation: '-L/Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/lib'
[ 68%] Building C object CMakeFiles/TH.dir/THDiskFile.c.o
[ 68%] Building C object CMakeFiles/TH.dir/THAtomic.c.o
[ 78%] Building C object CMakeFiles/TH.dir/vector/AVX.c.o
[ 78%] Building C object CMakeFiles/TH.dir/THVector.c.o
clang: warning: -Wl,-rpath,@loader_path: 'linker' input unused
clang: warning: argument unused during compilation: '-L/Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/lib'
[ 84%] Building C object CMakeFiles/TH.dir/generic/simd/convolve.c.o
clang: warning: -Wl,-rpath,@loader_path: 'linker' input unused
clang[ 94%] Building C object CMakeFiles/TH.dir/generic/simd/convolve5x5_avx.c.o
: warning: [ 94%] Building C object CMakeFiles/TH.dir/generic/simd/convolve5x5_sse.c.o
argument unused during compilation: '-L/Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/lib'
clang: warning: -Wl,-rpath,@loader_path: 'linker' input unused
clang: warning: argument unused during compilation: '-L/Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/lib'
clang: warning: -Wl,-rpath,@loader_path: 'linker' input unused
clang: warning: -Wl,-rpath,@loader_path: 'linker' input unused
clang: warning: argument unused during compilation: '-L/Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/lib'
clang: warning: argument unused during compilation: '-L/Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/lib'
clang: warning: -Wl,-rpath,@loader_path: 'linker' input unused
clang: warning: -Wl,-rpath,@loader_path: 'linker' input unused
clang: warning: argument unused during compilation: '-L/Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/lib'
clang: warning: argument unused during compilation: '-L/Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/lib'
clang: warning: -Wl,-rpath,@loader_path: 'linker' input unused
clang: warning: -Wl,-rpath,@loader_path: 'linker' input unused
clang: warning: argument unused during compilation: '-L/Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/lib'
clang: warning: -Wl,-rpath,@loader_path: 'linker' input unused
clang: warning: argument unused during compilation: '-L/Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/lib'
clang: warning: -Wl,-rpath,@loader_path: 'linker' input unused
clang: warning: -Wl,-rpath,@loader_path: 'linker' input unused
clang: warning: argument unused during compilation: '-L/Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/lib'
clang: warning: argument unused during compilation: '-L/Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/lib'
clang: warning: argument unused during compilation: '-L/Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/lib'
[100%] Linking C shared library libTH.dylib
ld: warning: directory not found for option '-L/Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/lib'
[100%] Built target TH
Install the project...
-- Install configuration: "Release"
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/lib/libTH.1.dylib
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/lib/libTH.dylib
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/TH.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/THAllocator.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/THMath.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/THBlas.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/THDiskFile.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/THFile.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/THFilePrivate.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/THGeneral.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/THGenerateAllTypes.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/THGenerateHalfType.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/THGenerateFloatTypes.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/THGenerateIntTypes.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/THLapack.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/THLogAdd.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/THMemoryFile.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/THRandom.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/THStorage.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/THTensor.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/THTensorApply.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/THTensorDimApply.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/THTensorMacros.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/THVector.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/THAtomic.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/THHalf.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/vector/AVX.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/vector/AVX2.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/generic/THBlas.c
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/generic/THBlas.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/generic/THLapack.c
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/generic/THLapack.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/generic/THStorage.c
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/generic/THStorage.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/generic/THStorageCopy.c
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/generic/THStorageCopy.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/generic/THTensor.c
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/generic/THTensor.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/generic/THTensorConv.c
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/generic/THTensorConv.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/generic/THTensorCopy.c
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/generic/THTensorCopy.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/generic/THTensorLapack.c
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/generic/THTensorLapack.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/generic/THTensorMath.c
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/generic/THTensorMath.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/generic/THTensorRandom.c
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/generic/THTensorRandom.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/generic/THVectorDispatch.c
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/include/TH/generic/THVector.h
-- Installing: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/share/cmake/TH/THConfig.cmake
Updating install_name for libTH.1.dylib
-- The C compiler identification is AppleClang 7.0.2.7000181
-- The CXX compiler identification is AppleClang 7.0.2.7000181
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -- works
-- Detecting C compiler ABI info
-- Checking if C linker supports --verbose
-- Checking if C linker supports --verbose - no
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Checking if CXX linker supports --verbose
-- Checking if CXX linker supports --verbose - no
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- TH_LIBRARIES: /Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/lib/libTH.1.dylib
-- THS_SO_VERSION: 1
-- Configuring done
CMake Warning (dev):
  Policy CMP0042 is not set: MACOSX_RPATH is enabled by default.  Run "cmake
  --help-policy CMP0042" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  MACOSX_RPATH is not specified for the following targets:

   THS

#include &lt;string.h&gt;
         ^
clang: warning: argument unused during compilation: '-L/Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/lib'
clang: warning: -Wl,-rpath,@loader_path: 'linker' input unused
clang: warning: argument unused during compilation: '-L/Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/lib'
In file included from &lt;built-in&gt;:332:
In file included from &lt;command line&gt;:15:
In file included from /usr/local/cuda/include/cuda_runtime.h:116:
/usr/local/cuda/include/common_functions.h:65:10: fatal error: 'string.h' file not found
#include &lt;string.h&gt;
         ^
clang: warning: -Wl,-rpath,@loader_path: 'linker' input unused
clang: warning: argument unused during compilation: '-L/Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/lib'
clang: warning: -Wl,-rpath,@loader_path: 'linker' input unused
clang: warning: argument unused during compilation: '-L/Users/liangshiyu/Desktop/pytorch/torch/lib/tmp_install/lib'
In file included from &lt;built-in&gt;:332:
In file included from &lt;command line&gt;:15:
In file included from /usr/local/cuda/include/cuda_runtime.h:116:
/usr/local/cuda/include/common_functions.h:65:10: fatal error: 'string.h' file not found

/Users/liangshiyu/Desktop/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCSleep.cu.o


CMake Error at THC_generated_THCBlas.cu.o.cmake:207 (message):
  Error generating
  /Users/liangshiyu/Desktop/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCBlas.cu.o


make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCSleep.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCBlas.cu.o] Error 1
1 error generated.
CMake Error at THC_generated_THCReduceApplyUtils.cu.o.cmake:207 (message):
  Error generating
  /Users/liangshiyu/Desktop/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCReduceApplyUtils.cu.o


1 error generated.
make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCReduceApplyUtils.cu.o] Error 1
1 error generated.
CMake Error at THC_generated_THCTensor.cu.o.cmake:207 (message):
  Error generating
  /Users/liangshiyu/Desktop/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCTensor.cu.o


make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCTensor.cu.o] Error 1
1 error generated.
CMake Error at THC_generated_THCSortUtils.cu.o.cmake:207 (message):
  Error generating
  /Users/liangshiyu/Desktop/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCSortUtils.cu.o


make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCSortUtils.cu.o] Error 1
1CMake Error at THC_generated_THCTensorCopy.cu.o.cmake:207 (message):
  Error generating
  /Users/liangshiyu/Desktop/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorCopy.cu.o


 error generated.
make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCTensorCopy.cu.o] Error 1
CMake Error at THC_generated_THCStorageCopy.cu.o.cmake:207 (message):
  Error generating
  /Users/liangshiyu/Desktop/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCStorageCopy.cu.o


make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCStorageCopy.cu.o] Error 1
1 error generated.
CMake Error at THC_generated_THCTensorConv.cu.o.cmake:207 (message):
  Error generating
  /Users/liangshiyu/Desktop/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorConv.cu.o


make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCTensorConv.cu.o] Error 1
1 error generated.
CMake Error at THC_generated_THCTensorTypeUtils.cu.o.cmake:207 (message):
  Error generating
  /Users/liangshiyu/Desktop/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorTypeUtils.cu.o


make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCTensorTypeUtils.cu.o] Error 1
1 error generated.
CMake Error at THC_generated_THCTensorMathBlas.cu.o.cmake:207 (message):
  Error generating
  /Users/liangshiyu/Desktop/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorMathBlas.cu.o


make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCTensorMathBlas.cu.o] Error 1
1 error generated.
1 error generated.
CMake Error at THC_generated_THCTensorScatterGather.cu.o.cmake:207 (message):
  Error generating
  /Users/liangshiyu/Desktop/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorScatterGather.cu.o


make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCTensorScatterGather.cu.o] Error 1
CMake Error at THC_generated_THCTensorMathPairwise.cu.o.cmake:207 (message):
  Error generating
  /Users/liangshiyu/Desktop/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorMathPairwise.cu.o


make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCTensorMathPairwise.cu.o] Error 1
1 error generated.
CMake Error at THC_generated_THCTensorMathMagma.cu.o.cmake:207 (message):
  Error generating
  /Users/liangshiyu/Desktop/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorMathMagma.cu.o


make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCTensorMathMagma.cu.o] Error 1
1 error generated.
CMake Error at THC_generated_THCTensorIndex.cu.o.cmake:207 (message):
  Error generating
  /Users/liangshiyu/Desktop/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorIndex.cu.o


make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCTensorIndex.cu.o] Error 1
1 error generated.
CMake Error at THC_generated_THCHalf.cu.o.cmake:207 (message):
  Error generating
  /Users/liangshiyu/Desktop/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCHalf.cu.o


make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCHalf.cu.o] Error 1
1 error generated.
CMake Error at THC_generated_THCStorage.cu.o.cmake:207 (message):
  Error generating
  /Users/liangshiyu/Desktop/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCStorage.cu.o


make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCStorage.cu.o] Error 1
1 error generated.
CMake Error at THC_generated_THCTensorSort.cu.o.cmake:207 (message):
  Error generating
  /Users/liangshiyu/Desktop/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorSort.cu.o


make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCTensorSort.cu.o] Error 1
1 error generated.
1 error generated.
CMake Error at THC_generated_THCTensorMath2.cu.o.cmake:207 (message):
  Error generating
  /Users/liangshiyu/Desktop/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorMath2.cu.o


make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCTensorMath2.cu.o] Error 1
CMake Error at THC_generated_THCTensorTopK.cu.o.cmake:207 (message):
  Error generating
  /Users/liangshiyu/Desktop/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorTopK.cu.o


1 error generated.
make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCTensorTopK.cu.o] Error 1
CMake Error at THC_generated_THCTensorMathReduce.cu.o.cmake:207 (message):
  Error generating
  /Users/liangshiyu/Desktop/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorMathReduce.cu.o


make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCTensorMathReduce.cu.o] Error 1
1 error generated.
1 error generated.
CMake Error at THC_generated_THCTensorMathScan.cu.o.cmake:207 (message):
  Error generating
  /Users/liangshiyu/Desktop/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorMathScan.cu.o


make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCTensorMathScan.cu.o] Error 1
CMake Error at THC_generated_THCTensorMath.cu.o.cmake:207 (message):
  Error generating
  /Users/liangshiyu/Desktop/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorMath.cu.o


1 error generated.
make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCTensorMath.cu.o] Error 1
CMake Error at THC_generated_THCTensorMode.cu.o.cmake:207 (message):
  Error generating
  /Users/liangshiyu/Desktop/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorMode.cu.o


make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCTensorMode.cu.o] Error 1
1 error generated.
CMake Error at THC_generated_THCTensorRandom.cu.o.cmake:207 (message):
  Error generating
  /Users/liangshiyu/Desktop/pytorch/torch/lib/build/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorRandom.cu.o


make[2]: *** [CMakeFiles/THC.dir/THC_generated_THCTensorRandom.cu.o] Error 1
make[1]: *** [CMakeFiles/THC.dir/all] Error 2
make: *** [all] Error 2
</code></pre>

username: Clement
cooked: <p>I have the same problem and can’t manage to solve it.<br>
I think it comes from export “CMAKE_PREFIX_PATH=” but I’m not sure.</p>

username: smth
cooked: <p>your cuda is outdated, and hence the complaints that <code>string.h</code> is not found, etc.</p>

username: Clement
cooked: <p>Sorry I forgot to answer you. I finally managed to install it following a tutorial on youtube</p>

username: Oliver_Nina
cooked: <p>I had a similar problem and Clement indicated this tutorial helps install it.<br>
<div class="lazyYT" data-youtube-id="h8n6HrLfeJQ" data-youtube-title="0.1 – Install PyTorch on OSX" data-width="480" data-height="270" data-parameters="feature=oembed&amp;wmode=opaque"></div></p>
<p>The problem as already mentioned seems to be the xcode version not compatible with the version of cuda and a downward is necessary. Good luck</p>

username: pyroll
cooked: <aside class="quote no-group" data-username="smth" data-post="3" data-topic="1852">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/smth/48/13_2.png" class="avatar"> smth:</div>
<blockquote>
<p>string.h</p>
</blockquote>
</aside>
<p>halo! can you please explain where it should be? and also the proper paths in $PATH?<br>
cheers</p>