这是我在 stackoverflow 上的第一篇文章,所以如果格式不正确,我深表歉意!任何提示表示赞赏。
我当前的 python 版本是 3.8.8,我在 macOS Big Sur 11.4 上。我正在尝试使用 pip 安装 mpi4py (或任何东西,我尝试了许多不同的安装方法),似乎存在与 Xcode 位置相关的问题。错误消息很长,但在这里:
(base) Chases-MBP-2:~ chasehatcher$ pip3 install mpi4py
Collecting mpi4py
Using cached mpi4py-3.1.1.tar.gz (2.4 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Building wheels for collected packages: mpi4py
Building wheel for mpi4py (PEP 517) ... error
ERROR: Command errored out with exit status 1:
command: /Applications/anaconda3/bin/python /Applications/anaconda3/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /var/folders/_1/4377t0712373l3rn7m6mpvww0000gn/T/tmpyigpja5o
cwd: /private/var/folders/_1/4377t0712373l3rn7m6mpvww0000gn/T/pip-install-_gworypq/mpi4py_b01814505f9b4236a3e65fabc1eab560
Complete output (215 lines):
running bdist_wheel
running build
running build_src
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.8
creating build/lib.macosx-10.9-x86_64-3.8/mpi4py
copying src/mpi4py/run.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
copying src/mpi4py/__init__.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
copying src/mpi4py/bench.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
copying src/mpi4py/__main__.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
creating build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
copying src/mpi4py/futures/_base.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
copying src/mpi4py/futures/server.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
copying src/mpi4py/futures/__init__.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
copying src/mpi4py/futures/_core.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
copying src/mpi4py/futures/pool.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
copying src/mpi4py/futures/aplus.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
copying src/mpi4py/futures/__main__.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
copying src/mpi4py/futures/_lib.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
creating build/lib.macosx-10.9-x86_64-3.8/mpi4py/util
copying src/mpi4py/util/pkl5.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/util
copying src/mpi4py/util/dtlib.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/util
copying src/mpi4py/util/__init__.py -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/util
copying src/mpi4py/py.typed -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
copying src/mpi4py/__main__.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
copying src/mpi4py/__init__.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
copying src/mpi4py/run.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
copying src/mpi4py/bench.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
copying src/mpi4py/MPI.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
copying src/mpi4py/dl.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
copying src/mpi4py/__init__.pxd -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
copying src/mpi4py/libmpi.pxd -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
copying src/mpi4py/MPI.pxd -> build/lib.macosx-10.9-x86_64-3.8/mpi4py
creating build/lib.macosx-10.9-x86_64-3.8/mpi4py/include
creating build/lib.macosx-10.9-x86_64-3.8/mpi4py/include/mpi4py
copying src/mpi4py/include/mpi4py/mpi4py.MPI.h -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/include/mpi4py
copying src/mpi4py/include/mpi4py/mpi4py.MPI_api.h -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/include/mpi4py
copying src/mpi4py/include/mpi4py/mpi4py.h -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/include/mpi4py
copying src/mpi4py/include/mpi4py/mpi4py.i -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/include/mpi4py
copying src/mpi4py/include/mpi4py/mpi.pxi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/include/mpi4py
copying src/mpi4py/futures/__main__.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
copying src/mpi4py/futures/__init__.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
copying src/mpi4py/futures/_core.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
copying src/mpi4py/futures/aplus.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
copying src/mpi4py/futures/server.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
copying src/mpi4py/futures/pool.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
copying src/mpi4py/futures/_lib.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/futures
copying src/mpi4py/util/__init__.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/util
copying src/mpi4py/util/dtlib.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/util
copying src/mpi4py/util/pkl5.pyi -> build/lib.macosx-10.9-x86_64-3.8/mpi4py/util
running build_clib
MPI configuration: [mpi] from 'mpi.cfg'
checking for library 'lmpe' ...
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda3/include -arch x86_64 -I/Applications/anaconda3/include -arch x86_64 -c _configtest.c -o _configtest.o
dyld: Library not loaded: /usr/lib/libauto.dylib
Referenced from: /Applications/Xcode.app/Contents/SharedFrameworks/DebugSymbolsDT.framework/Versions/A/DebugSymbolsDT
Reason: image not found
gcc: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!
gcc: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switch
failure.
removing: _configtest.c _configtest.o
building 'mpe' dylib library
creating build/temp.macosx-10.9-x86_64-3.8
creating build/temp.macosx-10.9-x86_64-3.8/src
creating build/temp.macosx-10.9-x86_64-3.8/src/lib-pmpi
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda3/include -arch x86_64 -I/Applications/anaconda3/include -arch x86_64 -c src/lib-pmpi/mpe.c -o build/temp.macosx-10.9-x86_64-3.8/src/lib-pmpi/mpe.o
dyld: Library not loaded: /usr/lib/libauto.dylib
Referenced from: /Applications/Xcode.app/Contents/SharedFrameworks/DebugSymbolsDT.framework/Versions/A/DebugSymbolsDT
Reason: image not found
gcc: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!
gcc: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switch
warning: build_clib: command 'gcc' failed with exit status 71
warning: build_clib: building optional library "mpe" failed
checking for library 'vt-mpi' ...
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda3/include -arch x86_64 -I/Applications/anaconda3/include -arch x86_64 -c _configtest.c -o _configtest.o
dyld: Library not loaded: /usr/lib/libauto.dylib
Referenced from: /Applications/Xcode.app/Contents/SharedFrameworks/DebugSymbolsDT.framework/Versions/A/DebugSymbolsDT
Reason: image not found
gcc: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!
gcc: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switch
failure.
removing: _configtest.c _configtest.o
checking for library 'vt.mpi' ...
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda3/include -arch x86_64 -I/Applications/anaconda3/include -arch x86_64 -c _configtest.c -o _configtest.o
dyld: Library not loaded: /usr/lib/libauto.dylib
Referenced from: /Applications/Xcode.app/Contents/SharedFrameworks/DebugSymbolsDT.framework/Versions/A/DebugSymbolsDT
Reason: image not found
gcc: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!
gcc: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switch
failure.
removing: _configtest.c _configtest.o
building 'vt' dylib library
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda3/include -arch x86_64 -I/Applications/anaconda3/include -arch x86_64 -c src/lib-pmpi/vt.c -o build/temp.macosx-10.9-x86_64-3.8/src/lib-pmpi/vt.o
dyld: Library not loaded: /usr/lib/libauto.dylib
Referenced from: /Applications/Xcode.app/Contents/SharedFrameworks/DebugSymbolsDT.framework/Versions/A/DebugSymbolsDT
Reason: image not found
gcc: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!
gcc: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switch
warning: build_clib: command 'gcc' failed with exit status 71
warning: build_clib: building optional library "vt" failed
checking for library 'vt-mpi' ...
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda3/include -arch x86_64 -I/Applications/anaconda3/include -arch x86_64 -c _configtest.c -o _configtest.o
dyld: Library not loaded: /usr/lib/libauto.dylib
Referenced from: /Applications/Xcode.app/Contents/SharedFrameworks/DebugSymbolsDT.framework/Versions/A/DebugSymbolsDT
Reason: image not found
gcc: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!
gcc: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switch
failure.
removing: _configtest.c _configtest.o
checking for library 'vt.mpi' ...
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda3/include -arch x86_64 -I/Applications/anaconda3/include -arch x86_64 -c _configtest.c -o _configtest.o
dyld: Library not loaded: /usr/lib/libauto.dylib
Referenced from: /Applications/Xcode.app/Contents/SharedFrameworks/DebugSymbolsDT.framework/Versions/A/DebugSymbolsDT
Reason: image not found
gcc: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!
gcc: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switch
failure.
removing: _configtest.c _configtest.o
building 'vt-mpi' dylib library
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda3/include -arch x86_64 -I/Applications/anaconda3/include -arch x86_64 -c src/lib-pmpi/vt-mpi.c -o build/temp.macosx-10.9-x86_64-3.8/src/lib-pmpi/vt-mpi.o
dyld: Library not loaded: /usr/lib/libauto.dylib
Referenced from: /Applications/Xcode.app/Contents/SharedFrameworks/DebugSymbolsDT.framework/Versions/A/DebugSymbolsDT
Reason: image not found
gcc: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!
gcc: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switch
warning: build_clib: command 'gcc' failed with exit status 71
warning: build_clib: building optional library "vt-mpi" failed
checking for library 'vt-hyb' ...
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda3/include -arch x86_64 -I/Applications/anaconda3/include -arch x86_64 -c _configtest.c -o _configtest.o
dyld: Library not loaded: /usr/lib/libauto.dylib
Referenced from: /Applications/Xcode.app/Contents/SharedFrameworks/DebugSymbolsDT.framework/Versions/A/DebugSymbolsDT
Reason: image not found
gcc: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!
gcc: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switch
failure.
removing: _configtest.c _configtest.o
checking for library 'vt.ompi' ...
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda3/include -arch x86_64 -I/Applications/anaconda3/include -arch x86_64 -c _configtest.c -o _configtest.o
dyld: Library not loaded: /usr/lib/libauto.dylib
Referenced from: /Applications/Xcode.app/Contents/SharedFrameworks/DebugSymbolsDT.framework/Versions/A/DebugSymbolsDT
Reason: image not found
gcc: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!
gcc: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switch
failure.
removing: _configtest.c _configtest.o
building 'vt-hyb' dylib library
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda3/include -arch x86_64 -I/Applications/anaconda3/include -arch x86_64 -c src/lib-pmpi/vt-hyb.c -o build/temp.macosx-10.9-x86_64-3.8/src/lib-pmpi/vt-hyb.o
dyld: Library not loaded: /usr/lib/libauto.dylib
Referenced from: /Applications/Xcode.app/Contents/SharedFrameworks/DebugSymbolsDT.framework/Versions/A/DebugSymbolsDT
Reason: image not found
gcc: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!
gcc: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switch
warning: build_clib: command 'gcc' failed with exit status 71
warning: build_clib: building optional library "vt-hyb" failed
running build_ext
MPI configuration: [mpi] from 'mpi.cfg'
checking for dlopen() availability ...
checking for header 'dlfcn.h' ...
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda3/include -arch x86_64 -I/Applications/anaconda3/include -arch x86_64 -I/Applications/anaconda3/include/python3.8 -c _configtest.c -o _configtest.o
dyld: Library not loaded: /usr/lib/libauto.dylib
Referenced from: /Applications/Xcode.app/Contents/SharedFrameworks/DebugSymbolsDT.framework/Versions/A/DebugSymbolsDT
Reason: image not found
gcc: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!
gcc: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switch
failure.
removing: _configtest.c _configtest.o
failure.
checking for library 'dl' ...
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda3/include -arch x86_64 -I/Applications/anaconda3/include -arch x86_64 -I/Applications/anaconda3/include/python3.8 -c _configtest.c -o _configtest.o
dyld: Library not loaded: /usr/lib/libauto.dylib
Referenced from: /Applications/Xcode.app/Contents/SharedFrameworks/DebugSymbolsDT.framework/Versions/A/DebugSymbolsDT
Reason: image not found
gcc: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!
gcc: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switch
failure.
removing: _configtest.c _configtest.o
checking for function 'dlopen' ...
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda3/include -arch x86_64 -I/Applications/anaconda3/include -arch x86_64 -I/Applications/anaconda3/include/python3.8 -c _configtest.c -o _configtest.o
dyld: Library not loaded: /usr/lib/libauto.dylib
Referenced from: /Applications/Xcode.app/Contents/SharedFrameworks/DebugSymbolsDT.framework/Versions/A/DebugSymbolsDT
Reason: image not found
gcc: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!
gcc: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switch
failure.
removing: _configtest.c _configtest.o
building 'mpi4py.dl' extension
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda3/include -arch x86_64 -I/Applications/anaconda3/include -arch x86_64 -I/Applications/anaconda3/include/python3.8 -c src/dynload.c -o build/temp.macosx-10.9-x86_64-3.8/src/dynload.o
dyld: Library not loaded: /usr/lib/libauto.dylib
Referenced from: /Applications/Xcode.app/Contents/SharedFrameworks/DebugSymbolsDT.framework/Versions/A/DebugSymbolsDT
Reason: image not found
gcc: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!
gcc: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switch
warning: build_ext: command 'gcc' failed with exit status 71
warning: build_ext: building optional extension "mpi4py.dl" failed
checking for MPI compile and link ...
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Applications/anaconda3/include -arch x86_64 -I/Applications/anaconda3/include -arch x86_64 -I/Applications/anaconda3/include/python3.8 -c _configtest.c -o _configtest.o
dyld: Library not loaded: /usr/lib/libauto.dylib
Referenced from: /Applications/Xcode.app/Contents/SharedFrameworks/DebugSymbolsDT.framework/Versions/A/DebugSymbolsDT
Reason: image not found
gcc: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!
gcc: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switch
failure.
removing: _configtest.c _configtest.o
error: Cannot compile MPI programs. Check your configuration!!!
----------------------------------------
ERROR: Failed building wheel for mpi4py
Failed to build mpi4py
ERROR: Could not build wheels for mpi4py which use PEP 517 and cannot be installed directly