在测试open3d是否正常顺利安装时,出现了如下错误:
python -c "import open3d as o3d; print(o3d.__version__)"
Traceback (most recent call last):File "<string>", line 1, in <module>File "/Users/huangzhe/miniconda3/envs/open3d/lib/python3.8/site-packages/open3d/__init__.py", line 93, in <module>from open3d.cpu.pybind import (core, camera, data, geometry, io, pipelines,
ImportError: dlopen(/Users/huangzhe/miniconda3/envs/open3d/lib/python3.8/site-packages/open3d/cpu/pybind.cpython-38-darwin.so, 0x0002): Library not loaded: /opt/homebrew/opt/libomp/lib/libomp.dylibReferenced from: <A2C68595-9594-3758-BEFB-86BA2C701093> /Users/huangzhe/miniconda3/envs/open3d/lib/python3.8/site-packages/open3d/cpu/pybind.cpython-38-darwin.soReason: tried: '/opt/homebrew/opt/libomp/lib/libomp.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/libomp/lib/libomp.dylib' (no such file), '/opt/homebrew/opt/libomp/lib/libomp.dylib' (no such file), '/usr/local/lib/libomp.dylib' (no such file), '/usr/lib/libomp.dylib' (no such file, not in dyld cache)
解决方法是运行如下命令:
brew install --build-from-source libomp
问题即可解决,再运行测试open3d版本号的命令:
python3 -c "import open3d as o3d; print(o3d.__version__)"
即可显示版本号: