简体   繁体   中英

Installed open3d lib but the library is not loading

I am in the process of setting up my m1 pro max laptop. I have downloaded python, and I am installing all the required libs through pip. I am having problems installing open 3d lib.

When I run this:

import sys
print(sys.version)

import platform
print(platform.platform())

import numpy as np
import open3d as o3d


print("Load a ply point cloud, print it, and render it")
pcd = o3d.io.read_point_cloud("data/bun315.ply")
print(pcd)
print(np.asarray(pcd.points))
o3d.visualization.draw_geometries([pcd])

I get this error:

3.9.1 (v3.9.1:1e5d33e9b9, Dec  7 2020, 12:44:01) 
[Clang 12.0.0 (clang-1200.0.32.27)]
macOS-12.5.1-arm64-arm-64bit

Traceback (most recent call last):
  File "/Users/abdelnasser/Desktop/point clouds/bunny/hello.py", line 8, in <module>
    import open3d as o3d
  File "/Users/abdelnasser/Library/Python/3.9/lib/python/site-packages/open3d/__init__.py", line 97, in <module>
    from open3d.cpu.pybind import (camera, data, geometry, io, pipelines,
ImportError: dlopen(/Users/abdelnasser/Library/Python/3.9/lib/python/site-packages/open3d/cpu/pybind.cpython-39-darwin.so, 0x0002): Library not loaded: '/opt/homebrew/opt/libomp/lib/libomp.dylib'
  Referenced from: '/Users/abdelnasser/Library/Python/3.9/lib/python/site-packages/open3d/cpu/pybind.cpython-39-darwin.so'
  Reason: tried: '/opt/homebrew/opt/libomp/lib/libomp.dylib' (no such file), '/usr/lib/libomp.dylib' (no such file)

I have searched up the error but nothing has worked. Not sure why its trying homebrew, I downloaded it to see try some things but ended up removing it from my laptop. When trying to install the open 3d lib I have had no issues with intel and m2 air laptop, but for some reason its not working on this laptop.

brew install libomp solves the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM