0

每当我尝试在活页夹上运行以下笔记本代码时,都会收到此错误:

OSError Traceback(最近一次调用最后一次)来自 pyntcloud import PyntCloud ----> 2 import open3d as od 3 4 5 path ="objects\Brigdging.stl"

/srv/conda/envs/notebook/lib/python3.7/site-packages/open3d/init .py in 54 # 在加载 CUDA pybind dll 之前执行此操作以正确解析符号 55 try: # StopIteration if cpu version not available - --> 56 _CDLL(next((_Path( file ).parent / 'cpu').glob('pybind*'))) 57 除了 StopIteration: 58 pass

/srv/conda/envs/notebook/lib/python3.7/ctypes/ init .py in init (self, name, mode, handle, use_errno, use_last_error) 362 363 if handle is None: --> 364 self._handle = _dlopen(self._name, mode) 365 else: 366 self._handle = 句柄

OSError:libusb-1.0.so.0:无法打开共享对象文件:没有这样的文件或目录

应该安装 libusb,我在 requirements.txt 中检查了它 - 但它仍然无法正常工作,只有当我只在 localhost 上运行笔记本时。

from pyntcloud import PyntCloud
import open3d as od


path ="objects\Brigdging.stl"
n_size=32



if path.endswith(".stl") :
    test1_or = od.io.read_triangle_mesh(path)
    test1 = PyntCloud.from_instance("open3d", test1_or)
else:
    test1 = PyntCloud.from_file(path)
    
print(test1)
cloud = test1.get_sample(
            "mesh_random",
            n=100000,
            rgb=False,
            normals=False,
            as_PyntCloud=True)

cloud.plot()

voxelgrid_id = cloud.add_structure("voxelgrid", n_x=n_size, n_y=n_size, n_z=n_size)

voxelgrid = cloud.structures[voxelgrid_id]

voxelgrid.plot(d=3, mode="density", cmap="hsv"
4

1 回答 1

0

在仅包含您需要的特殊包和未固定版本requirements.txt的目录中进行更简单的操作。binder

然后apt.txt在目录中添加文件,binder内容如下:

libusb-1.0.0
libgl1-mesa-glx

处理libGLlibusb-1.0.0基于此处添加时出现的问题。

请参阅此处在 Jupyter Discourse 网站上解决此问题的讨论。

于 2021-02-07T19:19:41.660 回答