libxcb-xinerama.so.0: cannot open shared object file: No such file or directory

网友投稿 1411 2022-08-22 14:55:00

libxcb-xinerama.so.0: cannot open shared object file: No such file or directory

今天在ubutnu 18.04上装了mayavi, 但是写代码可视化点云的时候出现了下面的情况:

QLibraryPrivate::loadPlugin failed on "/home/eric/anaconda3/envs/pointnet/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqxcb.so" : "Cannot load library /home/eric/anaconda3/envs/pointnet/lib/python3.6/site-packages/PyQt5/Qt/plugins/platforms/libqxcb.so: (libxcb-xinerama.so.0: cannot open shared object file: No such file or directory)"qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.[1] 17841 abort (core dumped) python show_points.py

好象是与Pyqt5有关,可视化代码为:

import mayavi.mlabimport torchimport numpy as npmypointcloud=np.fromfile("/media/eric/My Passport/kitti/training/velodyne/003673.bin",dtype=np.float32,count=-1).reshape([-1,4])mypointcloud=torch.from_numpy(mypointcloud)print(mypointcloud.size())print(mypointcloud.type())def viz_mayavi(points,vals="distance"): x=points[:,0] y=points[:,1] z=points[:,2] r=points[:,3] d=torch.sqrt(x**2+y**2) if vals=="height": col=z else: col=d fig=mayavi.mlab.figure(bgcolor=(0,0,0),size=(1280,720)) mayavi.mlab.points3d(x,y,z, col, mode="point", colormap='spectral', figure=fig, ) mayavi.mlab.show()if __name__=="__main__": viz_mayavi(mypointcloud,vals="height")

解决方法

export QT_DEBUG_PLUGINS=1sudo apt install --reinstall libxcb-xinerama0

重新运行python程序就行了

参考文献

[1].Install fails with ubuntu repository. ​​not load the Qt platform plugin “xcb“错误怎么办. ​​https://m.yisu.com/zixun/310371.html​​

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:[leetcode] 915. Partition Array into Disjoint Intervals
下一篇:iOS的那些面试(ios面试基础知识)
相关文章